diff options
author | Namhyung Kim | 2013-09-25 17:32:04 +0200 |
---|---|---|
committer | Karel Zak | 2013-09-26 09:34:56 +0200 |
commit | c470cbfc85ffba5f0fae7a74d27553fd623a9844 (patch) | |
tree | a2300da6b77bdf37b4fdd68ddbf901d0cb5e5154 /libmount | |
parent | libmount: Get rid of an unnecessary check (diff) | |
download | kernel-qcow2-util-linux-c470cbfc85ffba5f0fae7a74d27553fd623a9844.tar.gz kernel-qcow2-util-linux-c470cbfc85ffba5f0fae7a74d27553fd623a9844.tar.xz kernel-qcow2-util-linux-c470cbfc85ffba5f0fae7a74d27553fd623a9844.zip |
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>
Diffstat (limited to 'libmount')
-rw-r--r-- | libmount/src/fs.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libmount/src/fs.c b/libmount/src/fs.c index 23c873d54..ebdc44fb9 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); |