summaryrefslogtreecommitdiffstats
path: root/libmount/src
diff options
context:
space:
mode:
authorKarel Zak2018-03-20 12:20:05 +0100
committerKarel Zak2018-03-20 12:20:05 +0100
commit4c9e4ce83c6dba651cd8621275b0d2c9d233258e (patch)
tree32a27417274319abf3c7407baa18cfda966ed114 /libmount/src
parentfstrim: fix fs.h and mount.h collision (diff)
downloadkernel-qcow2-util-linux-4c9e4ce83c6dba651cd8621275b0d2c9d233258e.tar.gz
kernel-qcow2-util-linux-4c9e4ce83c6dba651cd8621275b0d2c9d233258e.tar.xz
kernel-qcow2-util-linux-4c9e4ce83c6dba651cd8621275b0d2c9d233258e.zip
libmount: make sure we deallocate on parse error
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src')
-rw-r--r--libmount/src/tab_parse.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libmount/src/tab_parse.c b/libmount/src/tab_parse.c
index 02dd0c961..ba22ef4be 100644
--- a/libmount/src/tab_parse.c
+++ b/libmount/src/tab_parse.c
@@ -216,12 +216,14 @@ static int mnt_parse_mountinfo_line(struct libmnt_fs *fs, char *s)
if (!fs->optstr)
rc = -ENOMEM;
} else {
- free(fstype);
- free(src);
DBG(TAB, ul_debug(
"mountinfo parse error [sscanf rc=%d]: '%s'", rc, s));
rc = -EINVAL;
}
+
+ free(fstype);
+ free(src);
+
return rc;
}