Skip to content

Commit

Permalink
Make sure strings are moved into the rehash.
Browse files Browse the repository at this point in the history
  • Loading branch information
turnage committed Jan 13, 2014
1 parent 7bea39a commit aa57b00
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libtvm/tvm_htab.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,13 @@ static void htab_rehash(tvm_htab_t *orig, unsigned int size)
while(node)
{
next = node->next;
htab_add(new, node->key, node->value);
if(node->valptr)
if (node->valptr)
{
htab_add_str(new, node->key, node->valptr, strlen(node->valptr) + 1);
free(node->valptr);
}
else
htab_add(new, node->key, node->value);
free(node->key);
free(node);
node = next;
Expand Down

0 comments on commit aa57b00

Please sign in to comment.