output/outelf64.c: simplify stabs64_cleanup, dwarf64_cleanup
authorCyrill Gorcunov <gorcunov@gmail.com>
Fri, 6 Nov 2009 08:42:11 +0000 (11:42 +0300)
committerCyrill Gorcunov <gorcunov@gmail.com>
Fri, 6 Nov 2009 19:00:49 +0000 (22:00 +0300)
nasm_free is failsafe against NULL passed

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
output/outelf64.c

index 34fda6b..0e1fb9f 100644 (file)
@@ -1856,12 +1856,9 @@ static void stabs64_cleanup(void)
         ptr = ptr->next;
         nasm_free(del);
     }
-    if (stabbuf)
-        nasm_free(stabbuf);
-    if (stabrelbuf)
-        nasm_free(stabrelbuf);
-    if (stabstrbuf)
-        nasm_free(stabstrbuf);
+    nasm_free(stabbuf);
+    nasm_free(stabrelbuf);
+    nasm_free(stabstrbuf);
 }
 /* dwarf routines */
 static void dwarf64_init(void)
@@ -2180,26 +2177,16 @@ static void dwarf64_generate(void)
 
 static void dwarf64_cleanup(void)
 {
-    if (arangesbuf)
-        nasm_free(arangesbuf);
-    if (arangesrelbuf)
-        nasm_free(arangesrelbuf);
-    if (pubnamesbuf)
-        nasm_free(pubnamesbuf);
-    if (infobuf)
-        nasm_free(infobuf);
-    if (inforelbuf)
-        nasm_free(inforelbuf);
-    if (abbrevbuf)
-        nasm_free(abbrevbuf);
-    if (linebuf)
-        nasm_free(linebuf);
-    if (linerelbuf)
-        nasm_free(linerelbuf);
-    if (framebuf)
-        nasm_free(framebuf);
-    if (locbuf)
-        nasm_free(locbuf);
+    nasm_free(arangesbuf);
+    nasm_free(arangesrelbuf);
+    nasm_free(pubnamesbuf);
+    nasm_free(infobuf);
+    nasm_free(inforelbuf);
+    nasm_free(abbrevbuf);
+    nasm_free(linebuf);
+    nasm_free(linerelbuf);
+    nasm_free(framebuf);
+    nasm_free(locbuf);
 }
 static void dwarf64_findfile(const char * fname)
 {