[dm-devel] [PATCH 01/39] multipathd: correctly free refwwid in cli_add_map()
Hannes Reinecke
hare at suse.de
Thu Jun 16 09:47:07 UTC 2016
We need to free the refwwid only when present.
Found by coverity.
Signed-off-by: Hannes Reinecke <hare at suse.com>
---
multipathd/cli_handlers.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c
index a1b7052..52bcdaa 100644
--- a/multipathd/cli_handlers.c
+++ b/multipathd/cli_handlers.c
@@ -715,6 +715,7 @@ cli_add_map (void * v, char ** reply, int * len, void * data)
condlog(2, "%s: coalesce_paths failed",
param);
dm_lib_release();
+ FREE(refwwid);
}
} /*we attempt to create device only once*/
count++;
@@ -726,7 +727,6 @@ cli_add_map (void * v, char ** reply, int * len, void * data)
}
rc = ev_add_map(dev_path, alias, vecs);
FREE(alias);
- FREE(refwwid);
return rc;
}
--
2.6.6
More information about the dm-devel
mailing list