wipefs: fix FD leak on error [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
1539750f2a
commit
f1b64c1c1f
|
@ -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 *
|
||||
|
|
Loading…
Reference in New Issue