[Ocfs2-tools-devel] [PATCH] libocfs2: fix small memory leak in parse_feature()
Mark Fasheh
mfasheh at suse.com
Thu May 22 17:43:43 PDT 2008
We need to free the strdup'd string in case of error too.
Signed-off-by: Mark Fasheh <mfasheh at suse.com>
---
libocfs2/feature_string.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/libocfs2/feature_string.c b/libocfs2/feature_string.c
index 831edc1..bba800a 100644
--- a/libocfs2/feature_string.c
+++ b/libocfs2/feature_string.c
@@ -224,8 +224,10 @@ errcode_t parse_feature(const char *opts,
break;
}
}
- if (!ocfs2_supported_features[i].ff_str)
+ if (!ocfs2_supported_features[i].ff_str) {
+ free(options);
return OCFS2_ET_UNSUPP_FEATURE;
+ }
}
free(options);
--
1.5.4.1
More information about the Ocfs2-tools-devel
mailing list