elunna / hackem

SlashEM forked Unto Evil with a Splice of X and a dash of THEM.
Other
23 stars 8 forks source link

Memory leak in m_initweap #505

Open elunna opened 1 year ago

elunna commented 1 year ago

Found while playing locally

================================================================= ==13717==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 128 byte(s) in 1 object(s) allocated from:

0 0x7f381436a808 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144

#1 0x55f57f49e685 in alloc /home/user/hackem/src/alloc.c:46
#2 0x55f57fabde5e in mksobj /home/user/hackem/src/mkobj.c:852
#3 0x55f57f8bfcab in mongets /home/user/hackem/src/makemon.c:4176
#4 0x55f57f8a2b43 in m_initweap /home/user/hackem/src/makemon.c:1800
#5 0x55f57f8a4e72 in setup_mon_inventory /home/user/hackem/src/makemon.c:2304
#6 0x55f57f8b2d70 in makemon /home/user/hackem/src/makemon.c:3578
#7 0x55f57feba0ff in create_monster /home/user/hackem/src/sp_lev.c:1715
#8 0x55f57fec84f1 in spo_monster /home/user/hackem/src/sp_lev.c:3279
#9 0x55f57feddeda in sp_level_coder /home/user/hackem/src/sp_lev.c:5665
#10 0x55f57fee2f06 in load_special /home/user/hackem/src/sp_lev.c:6346
#11 0x55f57fab1241 in makemaz /home/user/hackem/src/mkmaze.c:1027
#12 0x55f57fa9a1c9 in makelevel /home/user/hackem/src/mklev.c:934
#13 0x55f57fa9d79a in mklev /home/user/hackem/src/mklev.c:1388
#14 0x55f57f65647e in goto_level /home/user/hackem/src/do.c:1926
#15 0x55f57f749350 in next_level /home/user/hackem/src/dungeon.c:1176
#16 0x55f57f6534f7 in dodown /home/user/hackem/src/do.c:1511
#17 0x55f57f5a7491 in rhack /home/user/hackem/src/cmd.c:5800
#18 0x55f57f49a774 in moveloop /home/user/hackem/src/allmain.c:859
#19 0x55f5801a1b15 in main ../sys/unix/unixmain.c:353
#20 0x7f3814036082 in __libc_start_main ../csu/libc-start.c:308

SUMMARY: AddressSanitizer: 128 byte(s) leaked in 1 allocation(s).