mahatma-kaganovich / honeyd

Automatically exported from code.google.com/p/honeyd
0 stars 0 forks source link

Small memory leaks #18

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I am seeing small memory leaks on startup in Honeyd 1.5c. There are three leaks 
in total:

1)
==22044== 288 bytes in 6 blocks are definitely lost in loss record 20 of 49
==22044==    at 0x4026FDE: malloc (vg_replace_malloc.c:207)
==22044==    by 0x41A467D: (within /lib/tls/i686/cmov/libc-2.9.so)
==22044==    by 0x41A6C7E: getaddrinfo (in /lib/tls/i686/cmov/libc-2.9.so)
==22044==    by 0x805EF45: cmd_proxy_getinfo (command.c:237)
==22044==    by 0x8060F5A: hydparse (parse.y:624)
==22044==    by 0x8061DD8: parse_configuration (parse.y:1202)
==22044==    by 0x8065360: config_read (config.c:133)
==22044==    by 0x8055440: main (honeyd.c:3544)

2)
==22044== 463 bytes in 98 blocks are definitely lost in loss record 26 of 49
==22044==    at 0x4026FDE: malloc (vg_replace_malloc.c:207)
==22044==    by 0x415434F: strdup (in /lib/tls/i686/cmov/libc-2.9.so)
==22044==    by 0x80678D3: parse_tl (personality.c:1166)
==22044==    by 0x8065EF3: personality_line (personality.c:1294)
==22044==    by 0x8069325: personality_parse (personality.c:1371)
==22044==    by 0x8055393: main (honeyd.c:3488)

3)
==22044== 1,607 (592 direct, 1,015 indirect) bytes in 37 blocks are definitely 
lost in loss 
record 31 of 49
==22044==    at 0x4025092: calloc (vg_replace_malloc.c:397)
==22044==    by 0x806E0DD: get_assoc (xprobe_assoc.c:148)
==22044==    by 0x806E1B2: parse_associations (xprobe_assoc.c:190)
==22044==    by 0x805535B: main (honeyd.c:3481)

Leak #1 is fixed by freeing the result of getaddrinfo when cloning a port. Leak 
#2 is fixed by 
freeing the options string in the personality->tests structure when it is 
freed. Leak #3 is fixed 
by checking if the assoc structure is already in the splay tree and if it is 
already found, then it is 
freed.

Original issue reported on code.google.com by pkwar...@gmail.com on 25 Jan 2010 at 5:39

Attachments:

GoogleCodeExporter commented 8 years ago
There is a cumulative patch fixing issues 13, 14 and 18 in issue 13.

Original comment by pkwar...@gmail.com on 3 Sep 2010 at 4:55