All of lore.kernel.org
 help / color / mirror / Atom feed
From: mwilck@suse.com
To: Christophe Varoqui <christophe.varoqui@opensvc.com>,
	Benjamin Marzinski <bmarzins@redhat.com>
Cc: dm-devel@redhat.com, Martin Wilck <mwilck@suse.com>
Subject: [dm-devel] [PATCH 2/2] multipath-tools unit tests: fix memory leaks in mpathvalid tests
Date: Fri, 18 Dec 2020 23:27:14 +0100	[thread overview]
Message-ID: <20201218222714.16209-2-mwilck@suse.com> (raw)
In-Reply-To: <20201218222714.16209-1-mwilck@suse.com>

From: Martin Wilck <mwilck@suse.com>

They break "make valgrind-test".

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 tests/mpathvalid.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/mpathvalid.c b/tests/mpathvalid.c
index 5ffabb9..cfe4bae 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.29.0


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


  reply	other threads:[~2020-12-18 22:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18 22:27 [dm-devel] [PATCH 1/2] multipath-tools tests: unversioned .so for valgrind tests mwilck
2020-12-18 22:27 ` mwilck [this message]
2020-12-18 23:20   ` [dm-devel] [PATCH 2/2] multipath-tools unit tests: fix memory leaks in mpathvalid tests Benjamin Marzinski
2020-12-18 23:19 ` [dm-devel] [PATCH 1/2] multipath-tools tests: unversioned .so for valgrind tests Benjamin Marzinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201218222714.16209-2-mwilck@suse.com \
    --to=mwilck@suse.com \
    --cc=bmarzins@redhat.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.