Page MenuHomeFreeBSD

Fix leak in mkfs_msdos(..)
ClosedPublic

Authored by ngie on Dec 6 2015, 12:14 AM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 29 2024, 12:14 AM
Unknown Object (File)
Apr 11 2024, 7:24 PM
Unknown Object (File)
Apr 9 2024, 10:11 PM
Unknown Object (File)
Mar 22 2024, 8:23 PM
Unknown Object (File)
Mar 22 2024, 8:23 PM
Unknown Object (File)
Mar 22 2024, 8:23 PM
Unknown Object (File)
Mar 9 2024, 7:32 AM
Unknown Object (File)
Feb 26 2024, 10:02 PM
Subscribers

Details

Reviewers
emaste
jilles
Summary

Fix leak in mkfs_msdos(..) by initializing img to NULL and free'ing at the end
of the function

PR: 204943
MFC after: 1 week
Reported by: David Binderman <dcb314@hotmail.com>
Sponsored by: EMC / Isilon Storage Division

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 1456
Build 1461: arc lint + arc unit

Event Timeline

ngie retitled this revision from to Fix leak in mkfs_msdos(..).
ngie updated this object.
ngie added a reviewer: emaste.
ngie added a subscriber: jilles.
jilles requested changes to this revision.Dec 6 2015, 1:24 PM
jilles added a reviewer: jilles.

I noticed two unexpected return -1. They are not a memory leak but inconsistent.

It looks good otherwise.

sbin/newfs_msdos/mkfs_msdos.c
290

Why is there no goto done here?

298

and here?

This revision now requires changes to proceed.Dec 6 2015, 1:24 PM
ngie edited edge metadata.

Add a couple missing goto dones spotted by jilles

ngie marked 2 inline comments as done.Dec 6 2015, 8:09 PM

Fixed the accidental oversights -- thanks :).

jilles edited edge metadata.
This revision is now accepted and ready to land.Dec 6 2015, 8:11 PM
emaste edited edge metadata.

Can you notify Christos as well in the hope that NetBSD will apply an equivalent change?

Can you notify Christos as well in the hope that NetBSD will apply an equivalent change?