]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix memory leak in virNetClientIOWriteMessage
authorSergey Fionov <fionov@gmail.com>
Sun, 17 Feb 2013 14:20:59 +0000 (18:20 +0400)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 20 Feb 2013 16:56:35 +0000 (17:56 +0100)
Commit 18937c3ae0990b4417a43aa07a2c35aaf8cb6ec2 introduced the
memory leak when client->msg.fds is copied to thecall->msg
and then never freed.

src/rpc/virnetclient.c

index 4efa578fd999b24211befd9e22a70f9e959eb8d6..bfa1624503929ec6aa97aab4c1f6c72ef4990808 100644 (file)
@@ -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;