<div dir="ltr">Merged.<div>Thanks.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 18, 2016 at 2:14 PM,  <span dir="ltr"><<a href="mailto:tang.junhui@zte.com.cn" target="_blank">tang.junhui@zte.com.cn</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: "tang.junhui" <<a href="mailto:tang.junhui@zte.com.cn">tang.junhui@zte.com.cn</a>><br>
<br>
Problem:<br>
Memory leak exists in reconfigure() when multipathd command reconfigure is executed.<br>
<br>
Reasons:<br>
 * The following judgment condition is not satisfied when there is no path,<br>
   free_pathvec() is not called to free the vector of vecs->pathvec:<br>
       if (VECTOR_SIZE(vecs->pathvec))<br>
           free_pathvec(vecs->pathvec, FREE_PATHS);<br>
 * Then the vecs->pathvec is set to NULL, so the vector memory which<br>
   vecs->pathvec pointed to is leaked:<br>
       vecs->pathvec = NULL;<br>
<br>
Signed-off-by: tang.junhui <<a href="mailto:tang.junhui@zte.com.cn">tang.junhui@zte.com.cn</a>><br>
---<br>
 multipathd/main.c | 4 +---<br>
 1 file changed, 1 insertion(+), 3 deletions(-)<br>
<br>
diff --git a/multipathd/main.c b/multipathd/main.c<br>
index c129298..d9731cd 100644<br>
--- a/multipathd/main.c<br>
+++ b/multipathd/main.c<br>
@@ -1997,9 +1997,7 @@ reconfigure (struct vectors * vecs)<br>
        if (VECTOR_SIZE(vecs->mpvec))<br>
                remove_maps_and_stop_waiters(vecs);<br>
<br>
-       if (VECTOR_SIZE(vecs->pathvec))<br>
-               free_pathvec(vecs->pathvec, FREE_PATHS);<br>
-<br>
+       free_pathvec(vecs->pathvec, FREE_PATHS);<br>
        vecs->pathvec = NULL;<br>
<br>
        /* Re-read any timezone changes */<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.8.1.windows.1<br>
<br>
--------------------------------------------------------<br>
ZTE Information Security Notice: The information contained in this mail (and any attachment transmitted herewith) is privileged and confidential and is intended for the exclusive use of the addressee(s).  If you are not an intended recipient, any disclosure, reproduction, distribution or other dissemination or use of the information contained is strictly prohibited.  If you have received this mail in error, please delete it and notify us immediately.<br>
<br>
--<br>
dm-devel mailing list<br>
<a href="mailto:dm-devel@redhat.com">dm-devel@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/dm-devel" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/dm-devel</a><br>
</font></span></blockquote></div><br></div>