From: Namhyung Kim Date: Wed, 25 Sep 2013 15:32:04 +0000 (+0900) Subject: libmount: Free splitted optstr's when error occurred X-Git-Tag: v2.24-rc1~56 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c470cbfc85ffba5f0fae7a74d27553fd623a9844;p=thirdparty%2Futil-linux.git 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 --- diff --git a/libmount/src/fs.c b/libmount/src/fs.c index 23c873d541..ebdc44fb90 100644 --- a/libmount/src/fs.c +++ b/libmount/src/fs.c @@ -831,8 +831,12 @@ int mnt_fs_set_options(struct libmnt_fs *fs, const char *optstr) if (rc) return rc; n = strdup(optstr); - if (!n) + if (!n) { + free(u); + free(v); + free(f); return -ENOMEM; + } } free(fs->fs_optstr);