[PATCH] xfsprogs: fix potential memory leak in verify_set_primary_sb()
Li Zhong
zhong at linux.vnet.ibm.com
Sun Sep 22 01:01:19 CDT 2013
This patch tries to fix CID 997012, 997013 and 997014 reported by Coverity scan,
as suggested by sekharan.
Signed-off-by: Li Zhong <zhong at linux.vnet.ibm.com>
---
repair/sb.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/repair/sb.c b/repair/sb.c
index aa550e3..7abf47c 100644
--- a/repair/sb.c
+++ b/repair/sb.c
@@ -756,8 +756,10 @@ verify_set_primary_sb(xfs_sb_t *rsb,
/*
* see if we have enough superblocks to bother with
*/
- if (num_ok < num_sbs / 2)
- return(XR_INSUFF_SEC_SB);
+ if (num_ok < num_sbs / 2) {
+ retval = XR_INSUFF_SEC_SB;
+ goto out_free_list;
+ }
current = get_best_geo(list);
--
1.8.1.4
More information about the xfs
mailing list