- Fixed: When DeleteNode() deleted a node with two children, it freed the name of the

node that was moved into the spot of the deleted node, effectively making the
  immediate predecessor or successor of the deleted node inaccessible, since it was left
  with freed memory as a name.

SVN r1427 (trunk)
This commit is contained in:
Randy Heit 2009-02-19 23:15:11 +00:00
parent 83b212acbb
commit e0c76d6e4d

View file

@ -518,6 +518,7 @@ static void FreeNodesAtDepth(symbolNode_t **root, int depth)
static void DeleteNode(symbolNode_t *node, symbolNode_t **parent_p)
{
symbolNode_t **temp;
char *nametemp;
if(node->left == NULL)
{
@ -553,7 +554,9 @@ static void DeleteNode(symbolNode_t *node, symbolNode_t **parent_p)
temp = &(*temp)->left;
}
}
nametemp = node->name;
node->name = (*temp)->name;
(*temp)->name = nametemp;
node->type = (*temp)->type;
node->unused = (*temp)->unused;
node->imported = (*temp)->imported;