device-mapper-multipath/0085-multipath-tools-unit-tests-fix-memory-leaks-in-mpath.patch
Benjamin Marzinski b05147c356 device-mapper-multipath-0.8.5-6
Change patch format to remove Git version
  * Patches 0001-0122 only have the patch format modified
Update to the head of the upstream staging branch plus redhat patches
  * Patches 0123-0134 & 1036-0142 are from the upstream staging branch
  * Patches 0143-1046 have been submitted upstream
  * Patch 0156 is a Red Hat only patch. Red Hat udev rules set ID_SERIAL
    from 60-persistent-storage.rules instead of 55-scsi-sg3_id.rules.
    Multipath's parse_vpd_pg83() function needs to match the ID_SERIAL
    value from udev.
Rename files
  * Previous patches 0123-0132 are now patches 1035 & 0147-0155
2021-03-26 13:33:56 -05:00

51 lines
1.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Fri, 18 Dec 2020 23:17:48 +0100
Subject: [PATCH] multipath-tools unit tests: fix memory leaks in mpathvalid
tests
They break "make valgrind-test".
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
tests/mpathvalid.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/mpathvalid.c b/tests/mpathvalid.c
index 5ffabb9d..cfe4bae1 100644
--- a/tests/mpathvalid.c
+++ b/tests/mpathvalid.c
@@ -381,6 +381,7 @@ static void test_mpathvalid_is_path_good2(void **state)
assert_int_equal(mpathvalid_is_path(test_dev, MPATH_DEFAULT, &wwid,
wwids, 4), MPATH_IS_VALID);
assert_string_equal(wwid, TEST_WWID);
+ free(wwid);
}
static void test_mpathvalid_is_path_good3(void **state)
@@ -395,6 +396,7 @@ static void test_mpathvalid_is_path_good3(void **state)
assert_int_equal(mpathvalid_is_path(test_dev, MPATH_SMART, &wwid,
wwids, 4), MPATH_IS_VALID);
assert_string_equal(wwid, TEST_WWID);
+ free(wwid);
}
/* mabybe valid with no matching paths */
@@ -410,6 +412,7 @@ static void test_mpathvalid_is_path_good4(void **state)
assert_int_equal(mpathvalid_is_path(test_dev, MPATH_DEFAULT, &wwid,
wwids, 4), MPATH_IS_MAYBE_VALID);
assert_string_equal(wwid, TEST_WWID);
+ free(wwid);
}
/* maybe valid with matching paths */
@@ -425,6 +428,7 @@ static void test_mpathvalid_is_path_good5(void **state)
assert_int_equal(mpathvalid_is_path(test_dev, MPATH_DEFAULT, &wwid,
wwids, 4), MPATH_IS_VALID);
assert_string_equal(wwid, TEST_WWID);
+ free(wwid);
}
#define setup_test(name) \