[nasm:master] preproc: fix use of free() instead of nasm_free()

nasm-bot for H. Peter Anvin hpa at zytor.com
Mon Nov 7 17:12:38 PST 2022


Commit-ID:  a131b1129c2fa64dd5853e4bfaf71d4548dd9c50
Gitweb:     http://repo.or.cz/w/nasm.git?a=commitdiff;h=a131b1129c2fa64dd5853e4bfaf71d4548dd9c50
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Mon, 7 Nov 2022 12:09:04 -0800
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Mon, 7 Nov 2022 12:09:04 -0800

preproc: fix use of free() instead of nasm_free()

free() and nasm_free() are required to be compatible (as we may end up
having memory allocated on the heap by the C library), but that
doesn't mean we shouldn't use it whereever possible to allow for
better debugging.

Fixes: https://bugzilla.nasm.us/show_bug.cgi?id=3392804
Reported-by: C. Masloch <pushbx at ulukai.org>
Signed-off-by: H. Peter Anvin <hpa at zytor.com>


---
 asm/preproc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/asm/preproc.c b/asm/preproc.c
index 99218250..a12c96a2 100644
--- a/asm/preproc.c
+++ b/asm/preproc.c
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------- *
  *
- *   Copyright 1996-2021 The NASM Authors - All Rights Reserved
+ *   Copyright 1996-2022 The NASM Authors - All Rights Reserved
  *   See the file AUTHORS included with the NASM distribution for
  *   the specific copyright holders.
  *
@@ -1848,7 +1848,7 @@ static Token *new_Token_free(Token * next, enum token_type type,
 
     if (txtlen <= INLINE_TEXT) {
         memcpy(t->text.a, text, txtlen);
-        free(text);
+        nasm_free(text);
     } else {
         t->text.p.ptr = text;
     }


More information about the Nasm-commits mailing list