libvirt/esx-call-freeaddrinfo-earlier-in-esxUtil_ResolveHost.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

43 lines
1.4 KiB
Diff

From 9b80543fb6ebccf64d0bcbe91a2e97873886164c Mon Sep 17 00:00:00 2001
From: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
Date: Thu, 16 Mar 2023 07:03:51 +0000
Subject: [PATCH] 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.
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
Signed-off-by: tangbin <tangbin_yewu@cmss.chinamobile.com>
(cherry-pick from 3aaf23ff69cea9abb7b7a43d9ff3eb687a916a2e)
---
src/esx/esx_util.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/esx/esx_util.c b/src/esx/esx_util.c
index 89d136248f..98ce462ff0 100644
--- a/src/esx/esx_util.c
+++ b/src/esx/esx_util.c
@@ -311,17 +311,15 @@ esxUtil_ResolveHostname(const char *hostname,
errcode = getnameinfo(result->ai_addr, result->ai_addrlen, ipAddress,
ipAddress_length, NULL, 0, NI_NUMERICHOST);
+ freeaddrinfo(result);
if (errcode != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Formatting IP address for host '%s' failed: %s"), hostname,
gai_strerror(errcode));
- freeaddrinfo(result);
return -1;
}
- freeaddrinfo(result);
-
return 0;
}
--
2.27.0