Found another long-time error in which a hash table created during

ext2spice is not freed.  This may account for the rest of the memory
leak that was partially fixed in the previous commit.
This commit is contained in:
Tim Edwards 2021-12-13 16:55:02 -05:00
parent 82f280e23e
commit 7297ca079f
2 changed files with 4 additions and 2 deletions

View File

@ -265,6 +265,7 @@ EFFlatDone()
efFreeNodeList(&efNodeList); efFreeNodeList(&efNodeList);
HashFreeKill(&efCapHashTable); HashFreeKill(&efCapHashTable);
HashKill(&efNodeHashTable); HashKill(&efNodeHashTable);
HashKill(&efDistHashTable);
HashKill(&efHNUseHashTable); HashKill(&efHNUseHashTable);
return; return;
} }

View File

@ -607,7 +607,7 @@ efHNFromUse(hc, prefix)
char *srcp, *dstp; char *srcp, *dstp;
char name[2048], *namePtr; char name[2048], *namePtr;
Use *u = hc->hc_use; Use *u = hc->hc_use;
HierName *hierName; HierName *hierName, *hn;
bool hasX, hasY; bool hasX, hasY;
HashEntry *he; HashEntry *he;
unsigned size; unsigned size;
@ -663,7 +663,8 @@ efHNFromUse(hc, prefix)
} }
HashSetValue(he, (ClientData) hierName); HashSetValue(he, (ClientData) hierName);
(void) HashFind(&efFreeHashTable, (char *) hierName); for (hn = hierName; hn; hn = hn->hn_parent)
HashFind(&efFreeHashTable, (char *) hierName);
return hierName; return hierName;
} }