From 46e6b2b86e58e081fa40e9cc724f09f03ecf843e Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Tue, 4 Aug 2015 09:25:40 +0200 Subject: [PATCH] coverity: fix possible resource leak in lvmpolld-core /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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/daemons/lvmpolld/lvmpolld-core.c b/daemons/lvmpolld/lvmpolld-core.c index 1da2da229..140237382 100644 --- a/daemons/lvmpolld/lvmpolld-core.c +++ b/daemons/lvmpolld/lvmpolld-core.c @@ -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;