device-mapper-multipath/0085-multipath-tools-unit-tests-fix-memory-leaks-in-mpath.patch
Benjamin Marzinski 1dad67a5af device-mapper-multipath-0.8.5-1
Update Source to upstream version 0.8.5 plus post tag commits
  * Patches 0001-0102 are from
    https://github.com/openSUSE/multipath-tools/tree/queue and are
    already queued for upstream.
Rename files
  * Previous patches 0059-0068 are now patches 0103-0111
2021-01-19 18:06:09 -06:00

54 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) \
--
2.17.2