File multipath-tools-double-free-on-path-release of Package multipath-tools

commit 5256f53159435db2225b029d6281153f14880770
Author: Hannes Reinecke <hare@suse.de>
Date:   Wed Jan 28 09:25:52 2009 +0100

    Double free on path release
    
    When a map is being removed after all paths have been removed the
    paths vector is not cleared up properly. This resulted in the
    ominous 'glibc detected ...' error messages.
    
    Signed-off-by: Hannes Reinecke <hare@suse.de>

diff --git a/multipathd/main.c b/multipathd/main.c
index ec37c2d..e0f85e7 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -531,8 +531,8 @@ ev_remove_path (char * devname, struct vectors * vecs)
 				condlog(2, "%s: removed map after"
 					" removing all paths",
 					alias);
-				free_path(pp);
-				return 0;
+				retval = 0;
+				goto out_remove;
 			}
 			/*
 			 * Not an error, continue
@@ -568,6 +568,7 @@ ev_remove_path (char * devname, struct vectors * vecs)
 		}
 	}
 
+out_remove:
 	if ((i = find_slot(vecs->pathvec, (void *)pp)) != -1)
 		vector_del_slot(vecs->pathvec, i);
 
openSUSE Build Service is sponsored by