From e675e874fab46b7fec1543acc69d25393ae3d15c Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Sun, 9 Apr 2017 12:55:09 +0200 Subject: [PATCH] rpc: fix resource leak 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 (cherry picked from commit ab0a461b8c873e9b4999ed627bc8ce01d0105268) --- src/rpc/virnetdaemon.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rpc/virnetdaemon.c b/src/rpc/virnetdaemon.c index dcc89fa097..fabacf2039 100644 --- a/src/rpc/virnetdaemon.c +++ b/src/rpc/virnetdaemon.c @@ -401,6 +401,7 @@ virNetDaemonPreExecRestart(virNetDaemonPtr dmn) } } + VIR_FREE(srvArray); virObjectUnlock(dmn); return object; -- GitLab