diff mbox

[01/39] multipathd: correctly free refwwid in cli_add_map()

Message ID 1466070465-1021-2-git-send-email-hare@suse.de (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show

Commit Message

Hannes Reinecke June 16, 2016, 9:47 a.m. UTC
We need to free the refwwid only when present.
Found by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 multipathd/cli_handlers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

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;
 }