]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix a memory leak introduced in r328426.
authormarkj <markj@FreeBSD.org>
Fri, 16 Feb 2018 15:41:03 +0000 (15:41 +0000)
committermarkj <markj@FreeBSD.org>
Fri, 16 Feb 2018 15:41:03 +0000 (15:41 +0000)
commit65a57d392fc5e96a80167ec3ba42b8f3eb58f68b
treee767c12a340c04dc1f4e9c623612687b414de4fc
parentd543f5d1ea201424dbaefbbce82c3f5bc7757a0c
Fix a memory leak introduced in r328426.

ffs_sbget() may return a superblock buffer even if it fails, so the
caller must be prepared to free it in this case. Moreover, when tasting
alternate superblock locations in a loop, ffs_sbget()'s readfunc
callback must free the previously allocated buffer.

Reported and tested by: pho
Reviewed by: kib (previous version)
Differential Revision: https://reviews.freebsd.org/D14390
lib/libufs/sblock.c
stand/libsa/ufs.c
sys/geom/geom_io.c
sys/geom/journal/g_journal_ufs.c
sys/geom/label/g_label_ufs.c
sys/ufs/ffs/ffs_subr.c
sys/ufs/ffs/ffs_vfsops.c