Skip to content

Commit

Permalink
ndctl, check-namespace: fix resource leak
Browse files Browse the repository at this point in the history
Static analysis points out that we leak 'bttc' in namespace_check().

Cc: Vishal Verma <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
  • Loading branch information
djbw committed Jun 26, 2017
1 parent 65a6056 commit f81ccf1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ndctl/check.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,8 @@ int namespace_check(struct ndctl_namespace *ndns, struct check_opts *opts)

if (sigaction(SIGBUS, &act, 0)) {
err(bttc, "Unable to set sigaction\n");
return -errno;
rc = -errno;
goto out_bttc;
}

bttc->opts = opts;
Expand All @@ -912,7 +913,7 @@ int namespace_check(struct ndctl_namespace *ndns, struct check_opts *opts)
if (opts->force) {
rc = ndctl_namespace_disable_safe(ndns);
if (rc)
return rc;
goto out_bttc;
disabled_flag = 1;
} else {
err(bttc, "%s: check aborted, namespace online\n",
Expand Down

0 comments on commit f81ccf1

Please sign in to comment.