]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
rpc: fix resource leak
authorPavel Hrdina <phrdina@redhat.com>
Sun, 9 Apr 2017 10:55:09 +0000 (12:55 +0200)
committerCole Robinson <crobinso@redhat.com>
Wed, 10 May 2017 19:21:35 +0000 (15:21 -0400)
Commit 252610f7dd1 switched to use hash to store servers.
Function virHashGetItems returns allocated array which needs
to be freed also for successful path, not only if there is
an error.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
(cherry picked from commit ab0a461b8c873e9b4999ed627bc8ce01d0105268)

src/rpc/virnetdaemon.c

index dcc89fa09794f131d64508ee5a11ad1b70400c7d..fabacf20395dd5f6cdaa8fcd09c7e25059a09ca0 100644 (file)
@@ -401,6 +401,7 @@ virNetDaemonPreExecRestart(virNetDaemonPtr dmn)
         }
     }
 
+    VIR_FREE(srvArray);
     virObjectUnlock(dmn);
 
     return object;