libvirt/admin-fix-leak-of-typed-parameters-on-error.patch
Jiabo Feng 52e9a4d1d4 libvirt update to version 6.2.0-60
- vdpa: support vdpa device migrate
- vdpa: support vdpa device hot plug/unplug
- vdpa: Introduce the new device type vdpa to hostdev
- node_device: fix leak of DIR*
- Include vdpa devices in node device list
- lxc: fix lxcContainerMountAllFS() DEREF_BEFORE_CHECK
- qemu: Return perf status that affect next boot  for shutoff domains While we set up perf events for a shutoff domain and check the settings, All of perf events are reported as 'disabled', unless we add --config, This is redundant for a shutoff domain.
- tests: upstream Fixing compiler warning in cputest
- qemu_migration_cookie: Rename ret in qemuDomainExtractTLSSubject
- virrandom: Fix printf format string in virRandomGenerateWWN()
- fix the issue of errors when saving after 'virsh edit'
- Use (un)signed printf specifiers correctly
- admin: fix leak of typed parameters on error
- esx: call freeaddrinfo earlier in esxUtil_ResolveHostname Call freeaddrinfo() as soon as @result is not needed anymore, i.e. right after getnameinfo(); this avoids calling freeaddrinfo() in two branches.
- qemu: Fix incorrect command name in error messages

Signed-off-by: Jiabo Feng <fengjiabo1@huawei.com>
2023-12-05 21:06:20 +08:00

63 lines
2.0 KiB
Diff

From 90b8168fd93490f3a0fadadb38030163712a0e85 Mon Sep 17 00:00:00 2001
From: wangmeiyang <wangmeiyang@xfusion.com>
Date: Fri, 21 Apr 2023 14:43:45 +0800
Subject: [PATCH] admin: fix leak of typed parameters on error
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
A few admin client methods had the xdr_free call the wrong
side of the cleanup label, so typed parameters would not
be freed on error.
origin commit: https://gitlab.com/libvirt/libvirt/-/commit/0edf44664e9f2f75c7ba5faab91e2e190b5626af
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Meiyang Wang <wangmeiyang@xfusion.com>
---
src/admin/admin_remote.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/admin/admin_remote.c b/src/admin/admin_remote.c
index ca5e0c9fe4..2499fb8b0f 100644
--- a/src/admin/admin_remote.c
+++ b/src/admin/admin_remote.c
@@ -271,9 +271,9 @@ remoteAdminServerGetThreadPoolParameters(virAdmServerPtr srv,
goto cleanup;
rv = 0;
- xdr_free((xdrproc_t)xdr_admin_server_get_threadpool_parameters_ret, (char *) &ret);
cleanup:
+ xdr_free((xdrproc_t)xdr_admin_server_get_threadpool_parameters_ret, (char *) &ret);
virObjectUnlock(priv);
return rv;
}
@@ -344,9 +344,9 @@ remoteAdminClientGetInfo(virAdmClientPtr client,
goto cleanup;
rv = 0;
- xdr_free((xdrproc_t)xdr_admin_client_get_info_ret, (char *) &ret);
cleanup:
+ xdr_free((xdrproc_t)xdr_admin_client_get_info_ret, (char *) &ret);
virObjectUnlock(priv);
return rv;
}
@@ -382,10 +382,10 @@ remoteAdminServerGetClientLimits(virAdmServerPtr srv,
goto cleanup;
rv = 0;
- xdr_free((xdrproc_t) xdr_admin_server_get_client_limits_ret,
- (char *) &ret);
cleanup:
+ xdr_free((xdrproc_t) xdr_admin_server_get_client_limits_ret,
+ (char *) &ret);
virObjectUnlock(priv);
return rv;
}
--
2.27.0