bug-cflow
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Memory leaks in multiple locations


From: Li Shaohua
Subject: Memory leaks in multiple locations
Date: Fri, 23 Apr 2021 13:55:42 +0000

Hi there,

I found that there were multiple memory leak locations in clfow. In symbol.c:92, rc.c:97, linked-list.c:23, linked-list.c:35, linked-list.c:45, parser.c:1261, theyre all using xmalloc().

I have attached a poc file that will cause all those memory leaks.

Compiler args: 

> CC=/usr/bin/clang-11 CFLAGS=“-fsanitize=address” ./configure && make -j

The partial ASAN results are as follows (the full results are too long):

Indirect leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x495b6d in malloc (/data/clean/cflow/cflow-1.6/src/cflow+0x495b6d)
    #1 0x512b84 in xmalloc /data/clean/cflow/cflow-1.6/gnu/xmalloc.c:43:13
    #2 0x4d79f5 in linked_list_create /data/clean/cflow/cflow-1.6/src/linked-list.c:35:33
    #3 0x4e77ab in add_reference /data/clean/cflow/cflow-1.6/src/parser.c:1265:19
    #4 0x4e3bba in reference /data/clean/cflow/cflow-1.6/src/parser.c:1292:19
    #5 0x4e38e7 in _expression_ /data/clean/cflow/cflow-1.6/src/parser.c:621:7
    #6 0x4e6bf8 in func_body /data/clean/cflow/cflow-1.6/src/parser.c:1051:9
    #7 0x4e3625 in parse_variable_declaration /data/clean/cflow/cflow-1.6/src/parser.c:781:4
    #8 0x4e2de9 in parse_declaration /data/clean/cflow/cflow-1.6/src/parser.c:580:4
    #9 0x4e2d21 in yyparse /data/clean/cflow/cflow-1.6/src/parser.c:528:9
    #10 0x4d9615 in main /data/clean/cflow/cflow-1.6/src/main.c:812:7
    #11 0x7f16a81e783f in __libc_start_main /build/glibc-e6zv40/glibc-2.23/csu/../csu/libc-start.c:291

Indirect leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x495b6d in malloc (/data/clean/cflow/cflow-1.6/src/cflow+0x495b6d)
    #1 0x512b84 in xmalloc /data/clean/cflow/cflow-1.6/gnu/xmalloc.c:43:13
    #2 0x4e769a in add_reference /data/clean/cflow/cflow-1.6/src/parser.c:1261:15
    #3 0x4e39da in call /data/clean/cflow/cflow-1.6/src/parser.c:1276:11
    #4 0x4e38cd in _expression_ /data/clean/cflow/cflow-1.6/src/parser.c:618:7
    #5 0x4e6bf8 in func_body /data/clean/cflow/cflow-1.6/src/parser.c:1051:9
    #6 0x4e3625 in parse_variable_declaration /data/clean/cflow/cflow-1.6/src/parser.c:781:4
    #7 0x4e2de9 in parse_declaration /data/clean/cflow/cflow-1.6/src/parser.c:580:4
    #8 0x4e2d21 in yyparse /data/clean/cflow/cflow-1.6/src/parser.c:528:9
    #9 0x4d9615 in main /data/clean/cflow/cflow-1.6/src/main.c:812:7
    #10 0x7f16a81e783f in __libc_start_main /build/glibc-e6zv40/glibc-2.23/csu/../csu/libc-start.c:291

SUMMARY: AddressSanitizer: 22160 byte(s) leaked in 613 allocation(s).




Attachment: poc.zip
Description: poc.zip


reply via email to

[Prev in Thread] Current Thread [Next in Thread]