[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13565909#comment-13565909
 ] 

Colin Patrick McCabe commented on ZOOKEEPER-1632:
-------------------------------------------------

The valgrind run looks like this:

{code}
==19544==
==19544== HEAP SUMMARY:
==19544==     in use at exit: 7,183 bytes in 6 blocks
==19544==   total heap usage: 649 allocs, 643 frees, 61,217 bytes allocated
==19544==
==19544== 5 bytes in 1 blocks are definitely lost in loss record 1 of 5
==19544==    at 0x4C297CD: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==19544==    by 0x5748D81: strdup (in /lib64/libc-2.14.1.so)
==19544==    by 0x402BF1: processline (cli.c:458)
==19544==    by 0x401825: main (cli.c:612)
==19544==
==19544== 10 bytes in 2 blocks are definitely lost in loss record 2 of 5
==19544==    at 0x4C297CD: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==19544==    by 0x5748D81: strdup (in /lib64/libc-2.14.1.so)
==19544==    by 0x402AB1: processline (cli.c:433)
==19544==    by 0x401825: main (cli.c:612)
==19544==
==19544== 2,048 bytes in 1 blocks are definitely lost in loss record 4 of 5
==19544==    at 0x4C297CD: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==19544==    by 0x4C29957: realloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==19544==    by 0x4E43771: addrvec_grow (addrvec.c:85)
==19544==    by 0x4E43912: addrvec_append (addrvec.c:140)
==19544==    by 0x4E367B0: update_addrs (zookeeper.c:827)
==19544==    by 0x4E37A67: zookeeper_init (zookeeper.c:1069)
==19544==    by 0x4017A7: main (cli.c:583)
==19544==
==19544== LEAK SUMMARY:
==19544==    definitely lost: 2,063 bytes in 4 blocks
==19544==    indirectly lost: 0 bytes in 0 blocks
==19544==      possibly lost: 0 bytes in 0 blocks
==19544==    still reachable: 5,120 bytes in 2 blocks
==19544==         suppressed: 0 bytes in 0 blocks
==19544== Reachable blocks (those to which a pointer was found) are not shown.
==19544== To see them, rerun with: --leak-check=full --show-reachable=yes
==19544==
==19544== For counts of detected and suppressed errors, rerun with: -v
{code}
                
> fix memory leaks in cli_st 
> ---------------------------
>
>                 Key: ZOOKEEPER-1632
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1632
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: c client
>            Reporter: Colin Patrick McCabe
>            Assignee: Colin Patrick McCabe
>            Priority: Minor
>         Attachments: ZOOKEEPER-1632.001.patch
>
>
> Fix two memory leaks revealed by running:
> {code}
> valgrind --leak-check=full ./.libs/cli_st 127.0.0.1:2182
> create /foo
> quit
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to