[dm-devel] [PATCH 3/5] remove unnecessary free
lixiaokeng
lixiaokeng at huawei.com
Tue Nov 16 14:00:09 UTC 2021
arg will be free by cleanup_charp. FREE(args)
is unnecessary before return. Remove it.
Signed-off-by: Lixiaokeng <lixiaokeng at 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;
}
--
More information about the dm-devel
mailing list