xfs
[Top] [All Lists]

[PATCH] xfsprogs: fix agcnts leak in xfs_repair's scan_ags

To: "'linux-xfs@xxxxxxxxxxx'" <linux-xfs@xxxxxxxxxxx>
Subject: [PATCH] xfsprogs: fix agcnts leak in xfs_repair's scan_ags
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Wed, 31 Jul 2013 21:25:18 -0500
Delivered-to: linux-xfs@xxxxxxxxxxx
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130620 Thunderbird/17.0.7
agcnts is malloc'd but never freed in this function.

Coverity found this.

Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
---

diff --git a/repair/scan.c b/repair/scan.c
index 76bb7f1..4040f53 100644
--- a/repair/scan.c
+++ b/repair/scan.c
@@ -1367,6 +1367,8 @@ scan_ags(
                ifreecount += agcnts[i].ifreecount;
        }
 
+       free(agcnts);
+
        /*
         * Validate that our manual counts match the superblock.
         */

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] xfsprogs: fix agcnts leak in xfs_repair's scan_ags, Eric Sandeen <=