aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill O'Donnell <billodo@redhat.com>2017-06-29 13:05:41 -0500
committerEric Sandeen <sandeen@redhat.com>2017-06-29 13:05:41 -0500
commite177680d579619c54bf65adb7963e74e435eeb3b (patch)
tree9177793c6bf498eafb1a8666793a0ef7af81ca53
parentdb23e0f431a77d228b5f68ef0a8587c25c689133 (diff)
downloadxfsprogs-dev-e177680d579619c54bf65adb7963e74e435eeb3b.tar.gz
xfs_spaceman: fix potential memory leak by malloc in scan_ag
scan_ag mallocs memory that is potentially leaked. Add a free to alleviate the potential leak. Addresses-Coverity-Id: 1413772 Signed-off-by: Bill O'Donnell <billodo@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
-rw-r--r--spaceman/freesp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/spaceman/freesp.c b/spaceman/freesp.c
index 22aec82157..367c95d115 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)