diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2011-06-28 01:33:02 +0400 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2011-06-28 01:33:02 +0400 |
commit | b6c6ca96e7fab6f5356ecae363fc06dc2d61a12a (patch) | |
tree | 8ffa16cb767e493f47b92c2701f4fe8f70fdae0e /preproc.c | |
parent | c6a742cb6bbe9f6c866e62e9cdd1f3260a9ddf08 (diff) | |
download | nasm-b6c6ca96e7fab6f5356ecae363fc06dc2d61a12a.tar.gz nasm-b6c6ca96e7fab6f5356ecae363fc06dc2d61a12a.tar.bz2 nasm-b6c6ca96e7fab6f5356ecae363fc06dc2d61a12a.zip |
preproc: nasm_free is safe against NULL argument
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'preproc.c')
-rw-r--r-- | preproc.c | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -703,10 +703,8 @@ static void free_expdef(ExpDef * ed) */ static void free_expinv(ExpInv * ei) { - if (ei->name != NULL) - nasm_free(ei->name); - if (ei->label_text != NULL) - nasm_free(ei->label_text); + nasm_free(ei->name); + nasm_free(ei->label_text); nasm_free(ei); } @@ -1268,8 +1266,7 @@ static void delete_Blocks(void) * free it. */ while (b) { - if (b->chunk) - nasm_free(b->chunk); + nasm_free(b->chunk); a = b; b = b->next; if (a != &blocks) @@ -3485,8 +3482,7 @@ issue_error: macro_start = nasm_zalloc(sizeof(*macro_start)); macro_start->text = nasm_quote(p, strlen(p)); macro_start->type = TOK_STRING; - if (xsl) - nasm_free(xsl); + nasm_free(xsl); /* * We now have a macro name, an implicit parameter count of @@ -5395,8 +5391,7 @@ static void pp_cleanup(int pass) delete_Blocks(); while ((i = ipath)) { ipath = i->next; - if (i->path) - nasm_free(i->path); + nasm_free(i->path); nasm_free(i); } } |