public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfsprogs: fix potential memory leak in verify_set_primary_sb()
@ 2013-09-22  6:01 Li Zhong
  2013-09-24 18:59 ` Mark Tinguely
  0 siblings, 1 reply; 16+ messages in thread
From: Li Zhong @ 2013-09-22  6:01 UTC (permalink / raw)
  To: xfsprogs; +Cc: Chandra Seetharaman

This patch tries to fix CID 997012, 997013 and 997014 reported by Coverity scan,
as suggested by sekharan.

Signed-off-by: Li Zhong <zhong@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



_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2013-10-18 16:43 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-22  6:01 [PATCH] xfsprogs: fix potential memory leak in verify_set_primary_sb() Li Zhong
2013-09-24 18:59 ` Mark Tinguely
2013-09-25  7:32   ` [PATCH v2] " Li Zhong
2013-09-25 13:26     ` Mark Tinguely
2013-09-25 14:28     ` Eric Sandeen
2013-09-26  6:41       ` Li Zhong
2013-09-26  6:45       ` [PATCH v3 1/2] " Li Zhong
2013-09-26  6:48         ` [PATCH 2/2] xfsprogs: fix return value of verify_set_primary_sb() Li Zhong
2013-09-26 14:43           ` Eric Sandeen
2013-10-18 16:42           ` Rich Johnston
2013-09-26 14:31         ` [PATCH v3 1/2] xfsprogs: fix potential memory leak in verify_set_primary_sb() Eric Sandeen
2013-09-27  3:05           ` Li Zhong
2013-09-27  3:24             ` Eric Sandeen
2013-09-27  5:24               ` Li Zhong
2013-10-18 16:40         ` Rich Johnston
2013-09-25  7:34   ` [PATCH] " Li Zhong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox