代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/multipath-tools 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 3b8da487d534eb49c8c59d1a9c2d6199c0716572 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Tue, 9 Oct 2018 18:03:14 -0500
Subject: [PATCH] multipathd: fix memory leak on error in configure
If configure fails after allocing mpvec, it must free it. Found by
coverity.
Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
multipathd/main.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/multipathd/main.c b/multipathd/main.c
index 463b1b82..04dce04c 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -2278,7 +2278,7 @@ configure (struct vectors * vecs)
ret = path_discovery(vecs->pathvec, DI_ALL);
if (ret < 0) {
condlog(0, "configure failed at path discovery");
- return 1;
+ goto fail;
}
vector_foreach_slot (vecs->pathvec, pp, i){
@@ -2295,7 +2295,7 @@ configure (struct vectors * vecs)
}
if (map_discovery(vecs)) {
condlog(0, "configure failed at map discovery");
- return 1;
+ goto fail;
}
/*
@@ -2309,7 +2309,7 @@ configure (struct vectors * vecs)
force_reload = FORCE_RELOAD_YES;
if (ret) {
condlog(0, "configure failed while coalescing paths");
- return 1;
+ goto fail;
}
/*
@@ -2318,7 +2318,7 @@ configure (struct vectors * vecs)
*/
if (coalesce_maps(vecs, mpvec)) {
condlog(0, "configure failed while coalescing maps");
- return 1;
+ goto fail;
}
dm_lib_release();
@@ -2354,6 +2354,10 @@ configure (struct vectors * vecs)
i--;
}
return 0;
+
+fail:
+ vector_free(mpvec);
+ return 1;
}
int
--
2.11.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。