diff options
author | Karel Zak | 2018-03-20 12:20:05 +0100 |
---|---|---|
committer | Karel Zak | 2018-03-20 12:20:05 +0100 |
commit | 4c9e4ce83c6dba651cd8621275b0d2c9d233258e (patch) | |
tree | 32a27417274319abf3c7407baa18cfda966ed114 /libmount/src | |
parent | fstrim: fix fs.h and mount.h collision (diff) | |
download | kernel-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.c | 6 |
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; } |