<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 11/30/2011 02:26 PM, Wen Congyang wrote:
<blockquote cite="mid:4ED5CC86.3000308@cn.fujitsu.com" type="cite">
<pre wrap="">At 11/30/2011 01:57 PM, <a class="moz-txt-link-abbreviated" href="mailto:ajia@redhat.com">ajia@redhat.com</a> Write:
</pre>
<blockquote type="cite">
<pre wrap="">From: Alex Jia <a class="moz-txt-link-rfc2396E" href="mailto:ajia@redhat.com"><ajia@redhat.com></a>
Detected by Coverity. Leak introduced in commit 673adba.
Signed-off-by: Alex Jia <a class="moz-txt-link-rfc2396E" href="mailto:ajia@redhat.com"><ajia@redhat.com></a>
---
src/rpc/virnetclient.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
index a738129..9ed03a5 100644
--- a/src/rpc/virnetclient.c
+++ b/src/rpc/virnetclient.c
@@ -1740,6 +1740,7 @@ cleanup:
unlock:
virNetClientUnlock(client);
+ VIR_FREE(call);
</pre>
</blockquote>
<pre wrap="">
According to the comment:
/* If partially sent, then the call is still on the dispatch queue */
So I think we should not free call if it is still on the queue.
</pre>
</blockquote>
Yeah, it's a inappropriate place, in addition, in 'cleanup' label,
if ret !=1, also will free 'all', then 'unlock' label still do this,
the following should be a right place:<br>
<br>
1708 if (!client->sock || client->wantClose) {<br>
1709 virNetError(VIR_ERR_INTERNAL_ERROR, "%s",<br>
1710 _("client socket is closed"));<br>
<b>1711 VIR_FREE(call);</b><br>
1712 goto unlock;<br>
1713 }<br>
<br>
Thanks,<br>
Alex<br>
<blockquote cite="mid:4ED5CC86.3000308@cn.fujitsu.com" type="cite">
<pre wrap="">
Thanks
Wen Congyang
</pre>
<blockquote type="cite">
<pre wrap=""> return ret;
}
</pre>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
<br>
</body>
</html>