parse_mountinfo: fix and simplify the usage of r_fstype
1. parse_mountinfo() forgets to free(fst) if parse_mountinfo_ent() succeeds. 2. The usage of fst/r_fstype is ovecomplicated for no reason. Just change the parse_mountinfo() paths to populate/use/free this fsname unconditionally, and move the ownership to the caller. There is no reason to check FSTYPE__UNSUPPORTED and/or fallback to ->name. Better yet, we could even turn fsname into the local "char []" and avoid %ms and free(), but then we would need to pass the length of this buffer to parse_mountinfo_ent(). Signed-off-by:Oleg Nesterov <oleg@redhat.com> Reviewed-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
Showing
Please
register
or
sign in
to comment