From a8955bf07a7c0b8fd81ea74c362bd98b89ac1234 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 15 Jan 2020 11:56:00 +0100 Subject: [PATCH] cfdisk: check mnt_table_parse_fstab() return code [coverity scan] Signed-off-by: Karel Zak --- disk-utils/cfdisk.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- 2.47.3