[libvirt] [PATCH] Fix memory leak in virNetClientIOWriteMessage

Sergey Fionov fionov at gmail.com
Sun Feb 17 14:20:59 UTC 2013


Commit 18937c3ae0990b4417a43aa07a2c35aaf8cb6ec2 introduced the
memory leak when client->msg.fds is copied to thecall->msg
and then never freed.
---
  src/rpc/virnetclient.c |    1 +
  1 file changed, 1 insertion(+)

diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
index 4efa578..bfa1624 100644
--- a/src/rpc/virnetclient.c
+++ b/src/rpc/virnetclient.c
@@ -1182,6 +1182,7 @@ virNetClientIOWriteMessage(virNetClientPtr client,
          }
          thecall->msg->donefds = 0;
          thecall->msg->bufferOffset = thecall->msg->bufferLength = 0;
+        VIR_FREE(thecall->msg->fds);
          VIR_FREE(thecall->msg->buffer);
          if (thecall->expectReply)
              thecall->mode = VIR_NET_CLIENT_MODE_WAIT_RX;
-- 
1.7.10.4





More information about the libvir-list mailing list