Paths belong to the pathvec and should be freed from it.
Use cleanup_multipath() instead of cleanup_multipath_and_paths(),
and free the paths via the pathvec instead.

Suggested-by: Benjamin Marzinski <[email protected]>
Signed-off-by: Martin Wilck <[email protected]>
---
 multipath/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/multipath/main.c b/multipath/main.c
index 4b8d7dd..d28628b 100644
--- a/multipath/main.c
+++ b/multipath/main.c
@@ -214,12 +214,12 @@ static int check_usable_paths(struct config *conf,
                              const char *devpath, enum devtypes dev_type)
 {
        struct udev_device __attribute__((cleanup(cleanup_udev_device))) *ud = 
NULL;
-       struct multipath __attribute__((cleanup(cleanup_multipath_and_paths))) 
*mpp = NULL;
+       struct multipath __attribute__((cleanup(cleanup_multipath))) *mpp = 
NULL;
        struct pathgroup *pg;
        struct path *pp;
        char __attribute__((cleanup(cleanup_charp))) *params = NULL;
        char __attribute__((cleanup(cleanup_charp))) *status = NULL;
-       vector __attribute((cleanup(cleanup_vector))) pathvec = NULL;
+       vector __attribute((cleanup(cleanup_pathvec_and_free_paths))) pathvec = 
NULL;
        char uuid[DM_UUID_LEN];
        dev_t devt;
        int r = 1, i, j;
-- 
2.52.0


Reply via email to