From a27ccb9f61101091f16902035b3e019604473e24 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 19 Nov 2007 12:02:38 -0800 Subject: [PATCH] BR 877583: Fix RAA memory leak raa_free() didn't actually do the proper job; it would only free leaf nodes, not internal nodes. --- nasmlib.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nasmlib.c b/nasmlib.c index 6f598202..5c3601e8 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) -- 2.11.4.GIT