diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2015-11-19 11:05:15 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2015-11-19 11:05:15 +0100 |
commit | 36610fb6977dc430cd3b7fe26e82f774ba21cf81 (patch) | |
tree | f7b69475e04dbc50221535aeb97f1a1751073ce4 /linkhash.c | |
parent | c97bbd37972bd6e0ec9163a15db30b0159261be1 (diff) | |
download | json-c-36610fb6977dc430cd3b7fe26e82f774ba21cf81.tar.gz |
fix regression from 2d549662be832da838aa063da2efa78ee3b99668
That commit introduced read-only keys, but when the hash table
was resized, that attribute was not preserved. This resulted in
an invalid free at time of table destruction.
Diffstat (limited to 'linkhash.c')
-rw-r--r-- | linkhash.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -506,7 +506,9 @@ void lh_table_resize(struct lh_table *t, int new_size) new_t = lh_table_new(new_size, NULL, t->hash_fn, t->equal_fn); ent = t->head; while(ent) { - lh_table_insert(new_t, ent->k, ent->v); + lh_table_insert_w_hash(new_t, ent->k, ent->v, + lh_get_hash(new_t, ent->k), + (ent->k_is_constant) ? JSON_C_OBJECT_KEY_IS_CONSTANT : 0 ); ent = ent->next; } free(t->table); |