Fix leak in mpathpersist
authorBenjamin Marzinski <bmarzins@redhat.com>
Wed, 19 Feb 2020 06:48:25 +0000 (00:48 -0600)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Mon, 2 Mar 2020 08:43:24 +0000 (09:43 +0100)
If the persistent in command fails, the response buffer must be freed.
Found by Coverity

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
mpathpersist/main.c

index 5676166..28bfe41 100644 (file)
@@ -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;
                }