diff --git a/tools/pvscan.c b/tools/pvscan.c index 73a97be0d..9b5037496 100644 --- a/tools/pvscan.c +++ b/tools/pvscan.c @@ -655,6 +655,7 @@ int pvscan(struct cmd_context *cmd, int argc, char **argv) out: unlock_vg(cmd, VG_GLOBAL); + destroy_processing_handle(cmd, handle); return ret; } diff --git a/tools/vgreduce.c b/tools/vgreduce.c index a10e12c48..19a0bb035 100644 --- a/tools/vgreduce.c +++ b/tools/vgreduce.c @@ -237,8 +237,10 @@ int vgreduce(struct cmd_context *cmd, int argc, char **argv) vp.force = arg_count(cmd, force_ARG); /* Needed to change the set of orphan PVs. */ - if (!lockd_gl(cmd, "ex", 0)) - return_ECMD_FAILED; + if (!lockd_gl(cmd, "ex", 0)) { + ret = ECMD_FAILED; + goto_out; + } cmd->lockd_gl_disable = 1; cmd->handles_missing_pvs = 1; @@ -259,6 +261,7 @@ int vgreduce(struct cmd_context *cmd, int argc, char **argv) ret = ECMD_FAILED; out: init_ignore_suspended_devices(saved_ignore_suspended_devices); + destroy_processing_handle(cmd, handle); return ret; }