[PATCH] fix memory leak in check_path

12 Feb
2022
12 Feb
'22
4:35 p.m.
We get alias by strdup, and should free it after using. Sigined-off-by:lixiaokeng<lixiaokeng@huawei.com> --- multipathd/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/multipathd/main.c b/multipathd/main.c index 0327100..e4ff027 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -1900,10 +1900,12 @@ check_path (struct vectors * vecs, struct path * pp, int ticks) } if (ev_add_map(dev_path, alias, vecs)) { condlog(2, "fail to add map for mpp %s", alias); + FREE(alias); return 0; } else { condlog(2, "success to add map for mpp %s", alias); } + FREE(alias); } } else { return 0; --
1119
Age (days ago)
1119
Last active (days ago)
0 comments
1 participants
participants (1)
-
lixiaokeng