Linux Device Mapper development
 help / color / mirror / Atom feed
From: lixiaokeng <lixiaokeng@huawei.com>
To: Christophe Varoqui <christophe.varoqui@opensvc.com>,
	Martin Wilck <mwilck@suse.com>,
	Benjamin Marzinski <bmarzins@redhat.com>,
	"dm-devel mailing list" <dm-devel@redhat.com>
Cc: linfeilong <linfeilong@huawei.com>,
	"liuzhiqiang \(I\)" <liuzhiqiang26@huawei.com>
Subject: [dm-devel] [PATCH 3/5] remove unnecessary free
Date: Tue, 16 Nov 2021 22:00:09 +0800	[thread overview]
Message-ID: <8d2e8d87-67dd-e4e1-3253-abcd229c4546@huawei.com> (raw)
In-Reply-To: <78637f61-851d-cf9d-d308-9c22396d2071@huawei.com>

arg will be free by cleanup_charp. FREE(args)
is unnecessary before return. Remove it.

Signed-off-by: Lixiaokeng <lixiaokeng@huawei.com>
---
 libmultipath/prioritizers/weightedpath.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libmultipath/prioritizers/weightedpath.c b/libmultipath/prioritizers/weightedpath.c
index ea03fc3d..32d1cf0c 100644
--- a/libmultipath/prioritizers/weightedpath.c
+++ b/libmultipath/prioritizers/weightedpath.c
@@ -75,13 +75,12 @@ int prio_path_weight(struct path *pp, char *prio_args)
 	if (!prio_args)
 		return priority;

-	arg = temp = STRDUP(prio_args);
+	arg = temp = strdup(prio_args);

 	regex = get_next_string(&temp, split_char);

 	/* Return default priority if the argument is not parseable */
 	if (!regex) {
-		FREE(arg);
 		return priority;
 	}

-- 

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


  parent reply	other threads:[~2021-11-16 14:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-16 13:58 [dm-devel] [PATCH 0/5] multipath-tools series: some codeclean and add prflag to path lixiaokeng
2021-11-16 13:59 ` [dm-devel] [PATCH 1/5] Fix potential null pointer dereference lixiaokeng
2021-11-17 18:05   ` Benjamin Marzinski
2021-11-18  2:04     ` lixiaokeng
2021-11-16 13:59 ` [dm-devel] [PATCH 2/5] remove unnecessary memset lixiaokeng
2021-11-18  0:10   ` Benjamin Marzinski
2021-11-16 14:00 ` lixiaokeng [this message]
2021-11-18  0:14   ` [dm-devel] [PATCH 3/5] remove unnecessary free Benjamin Marzinski
2021-11-16 14:00 ` [dm-devel] [PATCH 4/5] Match FREE and MALLOC/STRDUP/REALLOC lixiaokeng
2021-11-18  0:47   ` Benjamin Marzinski
2021-11-18  2:46     ` lixiaokeng
2021-11-18 15:35       ` Martin Wilck
2021-11-18 15:31     ` Martin Wilck
2021-11-16 14:01 ` [dm-devel] [PATCH 5/5] add prflag to path lixiaokeng
2021-11-18 15:36   ` Martin Wilck
2021-11-18 16:57   ` Benjamin Marzinski
2021-11-19  8:41     ` lixiaokeng

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=8d2e8d87-67dd-e4e1-3253-abcd229c4546@huawei.com \
    --to=lixiaokeng@huawei.com \
    --cc=bmarzins@redhat.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@redhat.com \
    --cc=linfeilong@huawei.com \
    --cc=liuzhiqiang26@huawei.com \
    --cc=mwilck@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox