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)
Mon, Dec 2, 12:04 AM
Unknown Object (File)
Mon, Dec 2, 12:04 AM
Unknown Object (File)
Mon, Dec 2, 12:04 AM
Unknown Object (File)
Sun, Dec 1, 11:43 PM
Unknown Object (File)
Nov 18 2024, 2:17 PM
Unknown Object (File)
Nov 10 2024, 4:00 PM
Unknown Object (File)
Nov 1 2024, 1:06 PM
Unknown Object (File)
Oct 24 2024, 5:27 AM
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 1448
Build 1453: 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?