[Bug 204943] usr/src/sbin/newfs_msdos/mkfs_msdos.c:586: memory leak ?

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Dec 1 19:42:22 UTC 2015


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204943

NGie Cooper <ngie at FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |emaste at freebsd.org,
                   |                            |ngie at FreeBSD.org

--- Comment #1 from NGie Cooper <ngie at FreeBSD.org> ---
Yes, this is a leak. This should fix it:

$ svn diff sbin/newfs_msdos/mkfs_msdos.c 
Index: sbin/newfs_msdos/mkfs_msdos.c
===================================================================
--- sbin/newfs_msdos/mkfs_msdos.c       (revision 291608)
+++ sbin/newfs_msdos/mkfs_msdos.c       (working copy)
@@ -583,6 +583,7 @@
        si_sa.sa_handler = infohandler;
        if (sigaction(SIGINFO, &si_sa, NULL) == -1) {
            warn("sigaction SIGINFO");
+           free(img);
            return -1;
        }
        for (lsn = 0; lsn < dir + (fat == 32 ? bpb.bpbSecPerClust : rds);
lsn++) {

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list