diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-11-19 12:02:38 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-11-19 12:02:38 -0800 |
commit | a27ccb9f61101091f16902035b3e019604473e24 (patch) | |
tree | 29b6efe78d6cee2a6eac40306f1d12f04342b059 /nasmlib.c | |
parent | 61783742518d87373cabb1c79254ef5ae943beb7 (diff) | |
download | nasm-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.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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) |