]> sourceware.org Git - lvm2.git/commitdiff
coverity: fix possible resource leak in lvmpolld-core
authorPeter Rajnoha <prajnoha@redhat.com>
Tue, 4 Aug 2015 07:25:40 +0000 (09:25 +0200)
committerPeter Rajnoha <prajnoha@redhat.com>
Tue, 4 Aug 2015 07:25:47 +0000 (09:25 +0200)
/daemons/lvmpolld/lvmpolld-core.c:573: leaked_storage: Variable "cmdargv" going out of scope leaks the storage it points to.

daemons/lvmpolld/lvmpolld-core.c

index 1da2da2293082458777ba128fc84c5d9a8a83268..14023738229ac3a27888409c9aa2b36a8317b71a 100644 (file)
@@ -566,6 +566,8 @@ static struct lvmpolld_lv *construct_pdlv(request req, struct lvmpolld_state *ls
                return NULL;
        }
 
+       pdlv->cmdargv = cmdargv;
+
        cmdenvp = cmdenvp_ctr(pdlv);
        if (!cmdenvp) {
                pdlv_destroy(pdlv);
@@ -573,7 +575,6 @@ static struct lvmpolld_lv *construct_pdlv(request req, struct lvmpolld_state *ls
                return NULL;
        }
 
-       pdlv->cmdargv = cmdargv;
        pdlv->cmdenvp = cmdenvp;
 
        return pdlv;
This page took 0.036433 seconds and 5 git commands to generate.