Fix new/malloc/delete/free mismatches in Dictionary code

This commit is contained in:
Jon Siwek 2020-08-05 16:48:31 -07:00 committed by Tim Wojtulewicz
parent d566b8ca31
commit 37d3cfbd44
2 changed files with 4 additions and 4 deletions

View file

@ -567,7 +567,7 @@ void Dictionary::Clear()
delete_func(table[i].value);
table[i].Clear();
}
delete [] table;
free(table);
table = nullptr;
}
@ -731,7 +731,7 @@ void* Dictionary::Insert(void* key, int key_size, zeek::detail::hash_t hash, voi
v = table[position].value;
table[position].value = val;
if ( ! copy_key )
delete (char*)key;
delete [] (char*)key;
if ( order )
{//set new v to order too.