[PATCH] xfs_spaceman: fix potential memory leak by malloc in scan_ag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



scan_ag mallocs memory that is potentially leaked. Add a free
to alleviate the potential leak.

Fixes CoverityScan CID#1413772 (RESOURCE_LEAK)

Signed-off-by: Bill O'Donnell <billodo@xxxxxxxxxx>
---
 spaceman/freesp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/spaceman/freesp.c b/spaceman/freesp.c
index 22aec821..367c95d1 100644
--- a/spaceman/freesp.c
+++ b/spaceman/freesp.c
@@ -239,7 +239,9 @@ scan_ag(
 			printf(_("%10u %10llu %10llu\n"), agno, freeexts,
 					freeblks);
 	}
+	free(fsmap);
 }
+
 static void
 aglistadd(
 	char		*a)
-- 
2.13.0

--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux