From: Karel Zak Date: Tue, 20 Mar 2018 11:20:05 +0000 (+0100) Subject: libmount: make sure we deallocate on parse error X-Git-Tag: v2.32~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4c9e4ce83c6dba651cd8621275b0d2c9d233258e;p=thirdparty%2Futil-linux.git libmount: make sure we deallocate on parse error Signed-off-by: Karel Zak --- diff --git a/libmount/src/tab_parse.c b/libmount/src/tab_parse.c index 02dd0c9618..ba22ef4be2 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; }