]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_spaceman: fix potential memory leak by malloc in scan_ag
authorBill O'Donnell <billodo@redhat.com>
Thu, 29 Jun 2017 18:05:41 +0000 (13:05 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 29 Jun 2017 18:05:41 +0000 (13:05 -0500)
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>
spaceman/freesp.c

index 22aec82157f4069a09cb3c7889e75b176ca0563f..367c95d115049301c1d2610352b6477f73cff5fc 100644 (file)
@@ -239,7 +239,9 @@ scan_ag(
                        printf(_("%10u %10llu %10llu\n"), agno, freeexts,
                                        freeblks);
        }
+       free(fsmap);
 }
+
 static void
 aglistadd(
        char            *a)