qemu-kvm/kvm-tests-unit-test-util-sockets-fix-mem-leak-on-error-o.patch
Miroslav Rezanina fe4735fa0b * Mon Jun 09 2025 Miroslav Rezanina <mrezanin@redhat.com> - 10.0.0-5
- kvm-file-posix-Define-DM_MPATH_PROBE_PATHS.patch [RHEL-65852]
- kvm-file-posix-Probe-paths-and-retry-SG_IO-on-potential-.patch [RHEL-65852]
- kvm-io-Fix-partial-struct-copy-in-qio_dns_resolver_looku.patch [RHEL-67706]
- kvm-util-qemu-sockets-Refactor-setting-client-sockopts-i.patch [RHEL-67706]
- kvm-util-qemu-sockets-Refactor-success-and-failure-paths.patch [RHEL-67706]
- kvm-util-qemu-sockets-Add-support-for-keep-alive-flag-to.patch [RHEL-67706]
- kvm-util-qemu-sockets-Refactor-inet_parse-to-use-QemuOpt.patch [RHEL-67706]
- kvm-util-qemu-sockets-Introduce-inet-socket-options-cont.patch [RHEL-67706]
- kvm-tests-unit-test-util-sockets-fix-mem-leak-on-error-o.patch [RHEL-67706]
- Resolves: RHEL-65852
  (Support multipath failover with scsi-block)
- Resolves: RHEL-67706
  (postcopy on the destination host can't switch into pause status under the network issue if boot VM with '-S')
2025-06-09 02:12:27 -04:00

54 lines
1.9 KiB
Diff

From 450ca242645a6a2c68ea8aacbedfafec11c75fec Mon Sep 17 00:00:00 2001
From: Matheus Tavares Bernardino <matheus.bernardino@oss.qualcomm.com>
Date: Mon, 26 May 2025 10:20:55 -0700
Subject: [PATCH 9/9] tests/unit/test-util-sockets: fix mem-leak on error
object
RH-Author: Juraj Marcin <None>
RH-MergeRequest: 368: util/qemu-sockets: Introduce inet socket options controlling TCP keep-alive
RH-Jira: RHEL-67706
RH-Acked-by: Peter Xu <peterx@redhat.com>
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
RH-Commit: [7/7] ed714ea8693fe69166e7f991904bebd20636804a (JurajMarcin/centos-src-qemu-kvm)
The test fails with --enable-asan as the error struct is never freed.
In the case where the test expects a success but it fails, let's also
report the error for debugging (it will be freed internally).
Fixes 316e8ee8d6 ("util/qemu-sockets: Refactor inet_parse() to use QemuOpts")
Signed-off-by: Matheus Tavares Bernardino <matheus.bernardino@oss.qualcomm.com>
Reviewed-by: Juraj Marcin <jmarcin@redhat.com>
Message-ID: <518d94c7db20060b2a086cf55ee9bffab992a907.1748280011.git.matheus.bernardino@oss.qualcomm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
(cherry picked from commit 5c54a367265ec19ed94a535cd15d178c16b8cae0)
JIRA: https://issues.redhat.com/browse/RHEL-67706
Signed-off-by: Juraj Marcin <jmarcin@redhat.com>
---
tests/unit/test-util-sockets.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/unit/test-util-sockets.c b/tests/unit/test-util-sockets.c
index 8492f4d68f..ee66d727c3 100644
--- a/tests/unit/test-util-sockets.c
+++ b/tests/unit/test-util-sockets.c
@@ -341,8 +341,12 @@ static void inet_parse_test_helper(const char *str,
int rc = inet_parse(&addr, str, &error);
if (success) {
+ if (error) {
+ error_report_err(error);
+ }
g_assert_cmpint(rc, ==, 0);
} else {
+ error_free(error);
g_assert_cmpint(rc, <, 0);
}
if (exp_addr != NULL) {
--
2.39.3