]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
cfdisk: check mnt_table_parse_fstab() return code [coverity scan]
authorKarel Zak <kzak@redhat.com>
Wed, 15 Jan 2020 10:56:00 +0000 (11:56 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 15 Jan 2020 10:56:00 +0000 (11:56 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/cfdisk.c

index b219b2c62199d07ec22bf6e29cc17e7184b14a1f..89e54d6f430f28cccc69e2381c054239bd29e50b 100644 (file)
@@ -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)