Skip to content

Commit 05692ce

Browse files
a13579and2468a13579and2468
authored andcommitted
Subject: [PATCH] fix memory leak in asm/nasm.c
Bug analysis: When the first argument of nasm is a pathname without '.', forget to free outname before set outname = "nasm.out";. bugzilla: https://bugzilla.nasm.us/show_bug.cgi?id=3392800 Signed-off-by: Szu-Wei Tseng <13579and24680@gmail.com>
1 parent 3aebb20 commit 05692ce

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

asm/nasm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,7 @@ int main(int argc, char **argv)
607607
if (!outname && !(operating_mode & OP_PREPROCESS)) {
608608
outname = filename_set_extension(inname, ofmt->extension);
609609
if (!strcmp(outname, inname)) {
610+
nasm_free((char *)outname);
610611
outname = "nasm.out";
611612
nasm_warn(WARN_OTHER, "default output file same as input, using `%s' for output\n", outname);
612613
}

0 commit comments

Comments
 (0)