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

Flavio Junqueira commented on ZOOKEEPER-1632:
---------------------------------------------

I'm actually thinking that we should leave as my lastest patch proposed. It 
only leaks in the case the client fails to submit an operation, so something 
internal to ZK went wrong. In the regular case, it frees the line dup just fine.

Trying to fix it by simply freeing the line dup in the if(rc) block may cause 
the completion function to find a dangling pointer. 

> 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: Flavio Junqueira
>            Priority: Minor
>             Fix For: 3.4.6, 3.5.0
>
>         Attachments: ZOOKEEPER-1632-b3.4.patch, ZOOKEEPER-1632-trunk.patch, 
> ZOOKEEPER-1632.001.patch, ZOOKEEPER-1632.002.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 was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to