Re: [PATCH 3/4] libmount: Set each optstr's to NULL if failed

Karel Zak
2013-09-26T07:53:10Z

On Thu, Sep 26, 2013 at 12:32:05AM +0900, Namhyung Kim wrote:
> 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().

It's bug that mnt_fs_{ap,pre}pend_options() functions use the
pointers after failed mnt_split_optstr().

Anyway, it's probably better to be robust here so applied and also
fixed mnt_fs_{ap,pre}pend_options().

Thanks!

Karel