summaryrefslogtreecommitdiffstats
path: root/misc-utils/wipefs.c
diff options
context:
space:
mode:
authorKarel Zak2015-01-29 12:40:06 +0100
committerKarel Zak2015-01-29 12:42:58 +0100
commitf1b64c1c1f20c459077db36797dd5cc7063d8d55 (patch)
treed36c6aaa8b76c7db03f0dff4e1e29c3b5bb584d3 /misc-utils/wipefs.c
parentlsblk: implement SOMEOK (=64) return code (diff)
downloadkernel-qcow2-util-linux-f1b64c1c1f20c459077db36797dd5cc7063d8d55.tar.gz
kernel-qcow2-util-linux-f1b64c1c1f20c459077db36797dd5cc7063d8d55.tar.xz
kernel-qcow2-util-linux-f1b64c1c1f20c459077db36797dd5cc7063d8d55.zip
wipefs: fix FD leak on error [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/wipefs.c')
-rw-r--r--misc-utils/wipefs.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/misc-utils/wipefs.c b/misc-utils/wipefs.c
index 0daa87ae9..589f53503 100644
--- a/misc-utils/wipefs.c
+++ b/misc-utils/wipefs.c
@@ -240,7 +240,7 @@ new_probe(const char *devname, int mode)
goto error;
pr = blkid_new_probe();
- if (pr && blkid_probe_set_device(pr, fd, 0, 0)) {
+ if (!pr || blkid_probe_set_device(pr, fd, 0, 0) != 0) {
close(fd);
goto error;
}
@@ -266,7 +266,6 @@ new_probe(const char *devname, int mode)
error:
blkid_free_probe(pr);
err(EXIT_FAILURE, _("error: %s: probing initialization failed"), devname);
- return NULL;
}
static struct wipe_desc *