From 52aa54af3b65069d9abaebf943ff19fb6c4d3037 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Mon, 30 Sep 2019 16:56:33 +0100
Subject: [PATCH] admin: fix memory leak of typed parameters getting client
 info
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

In the error code path, the temporary parameters are not freed.

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry-picked from commit c76dc0ea39b4cbddaf9be22d50d13c4f529d6e2e)
Signed-off-by: Xu Yandong <xuyandong2@huawei.com>
---
 src/admin/admin_server.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/admin/admin_server.c b/src/admin/admin_server.c
index f2a38f6..ebf940d 100644
--- a/src/admin/admin_server.c
+++ b/src/admin/admin_server.c
@@ -296,6 +296,8 @@ adminClientGetInfo(virNetServerClientPtr client,
     ret = 0;
 
  cleanup:
+    if (tmpparams)
+        virTypedParamsFree(tmpparams, *nparams);
     virObjectUnref(identity);
     VIR_FREE(sock_addr);
     return ret;
-- 
2.21.0

