added initialization of record_status
@@ -310,7 +310,7 @@ split(
/* stores for record data */
ion_byte_t *record_key = alloca(linear_hash->super.record.key_size);
ion_byte_t *record_value = alloca(linear_hash->super.record.value_size);
- ion_byte_t record_status;
+ ion_byte_t record_status = 0;
/* ion_fpos_t linear_hash->record_total_size = linear_hash->super.record.key_size + linear_hash->super.record.value_size + sizeof(ion_byte_t); */
int split_hash_key;
@@ -318,6 +318,7 @@ split(
int i, j;
ion_byte_t *records = alloca(linear_hash->record_total_size * linear_hash->records_per_bucket);
+
memset(records, 0, linear_hash->record_total_size * linear_hash->records_per_bucket);
ion_fpos_t record_offset = 0;
@@ -666,12 +667,13 @@ linear_hash_get(
/* create a linear_hash_record with the desired key, value, and status of full*/
ion_byte_t *record_key = alloca(linear_hash->super.record.key_size);
ion_byte_t *record_value = alloca(linear_hash->super.record.value_size);
- ion_byte_t record_status;
+ ion_byte_t record_status = 0;
int found = 0;
int i;
ion_byte_t *records = alloca(linear_hash->record_total_size * linear_hash->records_per_bucket);
+
memset(records, 0, linear_hash->record_total_size * linear_hash->records_per_bucket);
ion_fpos_t record_offset = 0;
@@ -766,7 +768,7 @@ linear_hash_update(
/* create a temporary store for records that are read */
ion_byte_t *record_key = alloca(linear_hash->super.record.key_size);
ion_byte_t *record_value = alloca(linear_hash->super.record.value_size);
- ion_byte_t record_status;
+ ion_byte_t record_status = 0;
ion_fpos_t record_loc;
@@ -868,11 +870,12 @@ linear_hash_delete(
/* create a linear_hash_record with the desired key, value, and status of full*/
ion_byte_t *record_key = alloca(linear_hash->super.record.key_size);
ion_byte_t *record_value = alloca(linear_hash->super.record.value_size);
- ion_byte_t record_status;
+ ion_byte_t record_status = 0;
int i;
ion_byte_t *records = alloca(linear_hash->record_total_size * linear_hash->records_per_bucket);
+
memset(records, 0, linear_hash->record_total_size * linear_hash->records_per_bucket);
ion_fpos_t record_offset = 0;
@@ -881,7 +884,7 @@ linear_hash_delete(
/* memory allocated to transfer the terminal records to delete location for swap on delete */
ion_byte_t *terminal_record_key = alloca(linear_hash->super.record.key_size);
ion_byte_t *terminal_record_value = alloca(linear_hash->super.record.value_size);
- ion_byte_t terminal_record_status;
+ ion_byte_t terminal_record_status = 0;
while (bucket.overflow_location != -1) {
record_loc = bucket_loc + sizeof(linear_hash_bucket_t);
