mirror of
https://github.com/netwide-assembler/nasm
synced 2026-08-26 16:23:04 -04:00
asm/labels: fix memory leak in local label structures
Travis CI testing with AddressSanitizer (ASan) triggered a severe memory
leak in the assembler label tracking. Local label structures were not
properly freed during cleanup stages. This fix adds proper verification
and destruction of tracking labels, resolving the ASan memory leak.
Signed-off-by: alexvoste <alexvostedev@proton.me>
[ hpa: fixed indentation style and removed unnecessary { } ]
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
parent
3a33d83610
commit
cfcfe9e701
1 changed files with 3 additions and 0 deletions
|
|
@ -210,6 +210,9 @@ static union label *find_label(const char *label, bool create, bool *created)
|
|||
if (lptr || !create) {
|
||||
if (created)
|
||||
*created = false;
|
||||
if (label_str)
|
||||
nasm_free(label_str);
|
||||
|
||||
return lptr;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue