]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
stand/zfs: Fix memory leaking on error cases
authorWarner Losh <imp@FreeBSD.org>
Fri, 13 Jan 2023 21:20:00 +0000 (14:20 -0700)
committerWarner Losh <imp@FreeBSD.org>
Tue, 24 Jan 2023 21:49:46 +0000 (14:49 -0700)
commit379f5668e24ac173d7ab4cd865e82bccef6b1540
treef6577308c9fa39d3285176adaa5c697ba1bbeaa0
parent0cd6d49acf74ab0746a1be91453515e4eedb2a14
stand/zfs: Fix memory leaking on error cases

Now that we return an allocated zfs_devdesc, we have to free it. These
frees were missing from the error cases. In addition, simplify the code
a bit for the out of memory case.

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D38006

(cherry picked from commit 5385c7e13b06cb42a28bbf8c0d910b0c2ffddec7)
stand/libsa/zfs/zfs.c