From 29db40040c4c61e396185d04b8abd74d0c61b8f0 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Tue, 27 Aug 2019 11:47:52 +0200 Subject: [PATCH] remote_daemon_dispatch: Don't leak @ret on failure If there's a problem in encoding @ret (for instance virTypedParamsSerialize() fails) then @ret is leaked. Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- src/remote/remote_daemon_dispatch.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c index e205c743c3..c658a6e115 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -7025,8 +7025,11 @@ remoteDispatchConnectGetAllDomainStats(virNetServerPtr server ATTRIBUTE_UNUSED, rv = 0; cleanup: - if (rv < 0) + if (rv < 0) { virNetMessageSaveError(rerr); + xdr_free((xdrproc_t)xdr_remote_connect_get_all_domain_stats_ret, + (char *) ret); + } virDomainStatsRecordListFree(retStats); virObjectListFree(doms); -- GitLab