[dm-devel] [PATCH 3/5] remove unnecessary free
Benjamin Marzinski
bmarzins at redhat.com
Thu Nov 18 00:14:10 UTC 2021
On Tue, Nov 16, 2021 at 10:00:09PM +0800, lixiaokeng wrote:
> arg will be free by cleanup_charp. FREE(args)
> is unnecessary before return. Remove it.
>
> Signed-off-by: Lixiaokeng <lixiaokeng at huawei.com>
Reviewed-by: Benjamin Marzinski <bmarzins at redhat.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