libmount: Get rid of an unnecessary check

libmount_debug_mask was OR'ed to MNT_DEBUG_INIT so it should be non-null.
Thus the check is pointless.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
libmount: Free splitted optstr's when error occurred

When strdup() failed, u, v and f optstr's should be freed.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
libmount: Set each optstr's to NULL if failed

When mnt_split_optstr() failed in the middle, vfs, fs, user optstr's
are freed but not reset.  It can lead to double frees at the end of
mnt_fs_{ap,pre}pend_options().

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
libmount: Remove stale comment on mnt_context_mount()

The commit f9906424 ("libmount: add post-mount checks to detect ro/rw")
added necessary check so the comment is not valid anymore.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
libmount: make mnt_fs_{ap,pre}pend_options() more robust

We should not use the results from mnt_split_optstr() if the function
failed.

Signed-off-by: Karel Zak <kzak@redhat.com>