Skip to content

Commit 4bda1fb

Browse files
author
Jens Remus
committed
s390: s390_machinemode leak
This resolves the following memory leak reported by ASAN: Direct leak of 17 byte(s) in 1 object(s) allocated from: #0 0x3ffb32fbb1d in malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69 bminor#1 0x2aa149861cf in xmalloc ../../libiberty/xmalloc.c:149 bminor#2 0x2aa149868ff in xstrdup ../../libiberty/xstrdup.c:34 bminor#3 0x2aa1312391f in s390_machinemode ../../gas/config/tc-s390.c:2241 bminor#4 0x2aa130ddc7b in read_a_source_file ../../gas/read.c:1293 bminor#5 0x2aa1304f7bf in perform_an_assembly_pass ../../gas/as.c:1223 bminor#6 0x2aa1304f7bf in main ../../gas/as.c:1436 bminor#7 0x3ffb282be35 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 bminor#8 0x3ffb282bf33 in __libc_start_main_impl ../csu/libc-start.c:360 bminor#9 0x2aa1305758f (/home/jremus/git/binutils/build-asan/gas/as-new+0x2d5758f) (BuildId: ...) gas/ * config/tc-s390.c (s390_machinemode): Free mode_string before returning. Signed-off-by: Jens Remus <jremus@linux.ibm.com>
1 parent 163d991 commit 4bda1fb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

gas/config/tc-s390.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2287,6 +2287,7 @@ s390_machinemode (int ignore ATTRIBUTE_UNUSED)
22872287
s390_setup_opcodes ();
22882288
}
22892289

2290+
xfree (mode_string);
22902291
demand_empty_rest_of_line ();
22912292
}
22922293

0 commit comments

Comments
 (0)