summaryrefslogtreecommitdiff
path: root/nasmlib.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-11-19 12:02:38 -0800
committerH. Peter Anvin <hpa@zytor.com>2007-11-19 12:02:38 -0800
commita27ccb9f61101091f16902035b3e019604473e24 (patch)
tree29b6efe78d6cee2a6eac40306f1d12f04342b059 /nasmlib.c
parent61783742518d87373cabb1c79254ef5ae943beb7 (diff)
downloadnasm-a27ccb9f61101091f16902035b3e019604473e24.tar.gz
nasm-a27ccb9f61101091f16902035b3e019604473e24.tar.bz2
nasm-a27ccb9f61101091f16902035b3e019604473e24.zip
BR 877583: Fix RAA memory leak
raa_free() didn't actually do the proper job; it would only free leaf nodes, not internal nodes.
Diffstat (limited to 'nasmlib.c')
-rw-r--r--nasmlib.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/nasmlib.c b/nasmlib.c
index 6f59820..5c3601e 100644
--- a/nasmlib.c
+++ b/nasmlib.c
@@ -474,14 +474,13 @@ struct RAA *raa_init(void)
void raa_free(struct RAA *r)
{
- if (r->layers == 0)
- nasm_free(r);
- else {
+ if (r->layers) {
struct RAA **p;
for (p = r->u.b.data; p - r->u.b.data < RAA_LAYERSIZE; p++)
if (*p)
raa_free(*p);
}
+ nasm_free(r);
}
int64_t raa_read(struct RAA *r, int32_t posn)