Fix Coverity Scan CID 21929 (Using uninitialized value newtbl.num_elements when calling hashtable_insert.)

This commit is contained in:
Dong Anyuan
2019-06-20 12:40:04 +09:00
parent e84ba4fa6c
commit 3c81412704
+1
View File
@@ -358,6 +358,7 @@ hashtable_rc_t hashtable_resize(hash_table_t *const hashtblP, const hash_size_t
newtbl.size = sizeP;
newtbl.hashfunc = hashtblP->hashfunc;
newtbl.num_elements = 0;
if(!(newtbl.nodes=calloc(sizeP, sizeof(hash_node_t *)))) return -1;