Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leaks in rdpscan #11

Open
mikemadden42 opened this issue May 29, 2019 · 0 comments
Open

Memory leaks in rdpscan #11

mikemadden42 opened this issue May 29, 2019 · 0 comments

Comments

@mikemadden42
Copy link

It looks like there are a few memory leaks in rdpscan. Below are the the details when I build rdpscan with clang & gcc on Ubuntu.

jimi@woodstock:~/src/rdpscan$ lsb_release -sir
Ubuntu
18.04

jimi@woodstock:~/src/rdpscan$ gcc --version
gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

jimi@woodstock:~/src/rdpscan$ clang --version
clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
jimi@woodstock:~/src/rdpscan$ gcc -g -O1 -fsanitize=address -fno-omit-frame-pointer *.c -lssl -lcrypto -o rdpscan
jimi@woodstock:~/src/rdpscan$ ./rdpscan 192.168.0.0/24
....
....
....
....
=================================================================
==30450==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 2056 byte(s) in 1 object(s) allocated from:
    #0 0x7f8a92dbaf40 in realloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdef40)
    #1 0x55d6f7633eb5 in xrealloc /home/jimi/src/rdpscan/util-xmalloc.c:58
    #2 0x55d6f7618afd in main /home/jimi/src/rdpscan/main.c:488
    #3 0x7f8a9222ab96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Direct leak of 1616 byte(s) in 1 object(s) allocated from:
    #0 0x7f8a92dbad38 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded38)
    #1 0x55d6f763559f in spawn_workers /home/jimi/src/rdpscan/workers.c:671
    #2 0x55d6f76185a9 in main /home/jimi/src/rdpscan/main.c:501
    #3 0x7f8a9222ab96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7f8a92d53538 in strdup (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x77538)
    #1 0x55d6f7633e73 in xstrdup /home/jimi/src/rdpscan/util-xmalloc.c:41
    #2 0x55d6f7617ee4 in parse_commandline /home/jimi/src/rdpscan/main.c:417
    #3 0x55d6f7618485 in main /home/jimi/src/rdpscan/main.c:441
    #4 0x7f8a9222ab96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 3730 byte(s) in 256 object(s) allocated from:
    #0 0x7f8a92d53538 in strdup (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x77538)
    #1 0x55d6f7633e73 in xstrdup /home/jimi/src/rdpscan/util-xmalloc.c:41
    #2 0x55d6f7618b53 in main /home/jimi/src/rdpscan/main.c:489
    #3 0x7f8a9222ab96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

SUMMARY: AddressSanitizer: 7418 byte(s) leaked in 259 allocation(s).
jimi@woodstock:~/src/rdpscan$ clang -g -O1 -fsanitize=address -fno-omit-frame-pointer *.c -lssl -lcrypto -o rdpscan
jimi@woodstock:~/src/rdpscan$ ./rdpscan 192.168.0.0/24
....
....
....
....
=================================================================
==31018==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 2056 byte(s) in 1 object(s) allocated from:
    #0 0x4db8d0  (/home/jimi/src/rdpscan/rdpscan+0x4db8d0)
    #1 0x544a59  (/home/jimi/src/rdpscan/rdpscan+0x544a59)
    #2 0x52899a  (/home/jimi/src/rdpscan/rdpscan+0x52899a)
    #3 0x7f3098ee3b96  (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x437c70  (/home/jimi/src/rdpscan/rdpscan+0x437c70)
    #1 0x544a18  (/home/jimi/src/rdpscan/rdpscan+0x544a18)
    #2 0x528079  (/home/jimi/src/rdpscan/rdpscan+0x528079)
    #3 0x5285db  (/home/jimi/src/rdpscan/rdpscan+0x5285db)
    #4 0x7f3098ee3b96  (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 3730 byte(s) in 256 object(s) allocated from:
    #0 0x437c70  (/home/jimi/src/rdpscan/rdpscan+0x437c70)
    #1 0x544a18  (/home/jimi/src/rdpscan/rdpscan+0x544a18)
    #2 0x5289a6  (/home/jimi/src/rdpscan/rdpscan+0x5289a6)
    #3 0x7f3098ee3b96  (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

SUMMARY: AddressSanitizer: 5802 byte(s) leaked in 258 allocation(s).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant