If there's a problem in encoding @ret (for instance
virTypedParamsSerialize() fails) then @ret is leaked.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
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);
--
2.21.0