mkswap: check blkid_probe_lookup_values() return [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2012-01-31 13:10:58 +01:00
parent 2b6e6d5534
commit c596a05450
1 changed files with 4 additions and 4 deletions

View File

@ -407,10 +407,10 @@ wipe_device(int fd, const char *devname, int force, int is_blkdev)
blkid_probe_enable_partitions(pr, 1);
blkid_probe_enable_superblocks(pr, 0);
if (blkid_do_fullprobe(pr) == 0)
blkid_probe_lookup_value(pr, "PTTYPE",
(const char **) &type, NULL);
if (type) {
if (blkid_do_fullprobe(pr) == 0 &&
blkid_probe_lookup_value(pr, "PTTYPE",
(const char **) &type, NULL) == 0 &&
type) {
type = xstrdup(type);
zap = 0;
}