From: Karel Zak Date: Wed, 15 Jan 2020 10:56:00 +0000 (+0100) Subject: cfdisk: check mnt_table_parse_fstab() return code [coverity scan] X-Git-Tag: v2.35~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a8955bf07a7c0b8fd81ea74c362bd98b89ac1234;p=thirdparty%2Futil-linux.git cfdisk: check mnt_table_parse_fstab() return code [coverity scan] Signed-off-by: Karel Zak --- diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c index b219b2c621..89e54d6f43 100644 --- a/disk-utils/cfdisk.c +++ b/disk-utils/cfdisk.c @@ -1266,7 +1266,10 @@ static char *get_mountpoint(struct cfdisk *cf, const char *tagname, const char * cf->fstab = mnt_new_table(); if (cf->fstab) { mnt_table_set_cache(cf->fstab, cf->mntcache); - mnt_table_parse_fstab(cf->fstab, NULL); + if (mnt_table_parse_fstab(cf->fstab, NULL) != 0) { + mnt_unref_table(cf->fstab); + cf->fstab = NULL; + } } } if (cf->fstab)