These are freed in free_multipath(), which we call from remove_map().
Signed-off-by: Martin Wilck <[email protected]>
---
libmultipath/structs.c | 1 +
libmultipath/structs_vec.c | 4 ----
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/libmultipath/structs.c b/libmultipath/structs.c
index 6f2468d..0af46a2 100644
--- a/libmultipath/structs.c
+++ b/libmultipath/structs.c
@@ -321,6 +321,7 @@ void free_multipath(struct multipath *mpp)
pp->mpp = NULL;
free_pathvec(mpp->paths, KEEP_PATHS);
free_pgvec(mpp->pg);
+ mpp->paths = mpp->pg = NULL;
if (mpp->hwe) {
vector_free(mpp->hwe);
mpp->hwe = NULL;
diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c
index 54280a9..62b208b 100644
--- a/libmultipath/structs_vec.c
+++ b/libmultipath/structs_vec.c
@@ -423,10 +423,6 @@ void remove_map(struct multipath *mpp, vector pathvec)
{
remove_map_callback(mpp);
- free_pathvec(mpp->paths, KEEP_PATHS);
- free_pgvec(mpp->pg);
- mpp->paths = mpp->pg = NULL;
-
/*
* clear references to this map.
* This needs to be called before free_multipath(),
--
2.52.0