libmount: make sure we deallocate on parse error
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
a0357292b5
commit
4c9e4ce83c
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue