[dm-devel] [PATCH v3 03/18] Fix leak in mpathpersist

Benjamin Marzinski bmarzins at redhat.com
Wed Feb 19 06:48:25 UTC 2020


If the persistent in command fails, the response buffer must be freed.
Found by Coverity

Reviewed-by: Martin Wilck <mwilck at suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins at redhat.com>
---
 mpathpersist/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mpathpersist/main.c b/mpathpersist/main.c
index 56761668..28bfe410 100644
--- a/mpathpersist/main.c
+++ b/mpathpersist/main.c
@@ -499,6 +499,7 @@ static int handle_args(int argc, char * argv[], int nline)
 		if (ret != MPATH_PR_SUCCESS )
 		{
 			fprintf (stderr, "Persistent Reserve IN command failed\n");
+			free(resp);
 			goto out_fd;
 		}
 
-- 
2.17.2




More information about the dm-devel mailing list