From: Darrick J. Wong Date: Tue, 2 Jun 2026 04:59:37 +0000 (-0700) Subject: xfs_healer: don't leak wh->mntpoint if fd_to_handle fails X-Git-Tag: v7.1.0~69 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4d62c2fa83baa37a472e9f04996bb108c44a6ded;p=xfsprogs-dev.git xfs_healer: don't leak wh->mntpoint if fd_to_handle fails Codex noticed that we leak wh->mntpoint if fd_to_handle fails, so fix that leak. Cc: linux-xfs@vger.kernel.org # v7.0.0 Fixes: 6f0f35a87c8797 ("xfs_healer: enable repairing filesystems") Signed-off-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig --- diff --git a/healer/weakhandle.c b/healer/weakhandle.c index 506689aa..6c0dbb30 100644 --- a/healer/weakhandle.c +++ b/healer/weakhandle.c @@ -63,11 +63,13 @@ weakhandle_alloc( ret = fd_to_handle(fd, &wh->hanp, &wh->hlen); if (ret) - goto out_wh; + goto out_mntpt; *whp = wh; return 0; +out_mntpt: + free(wh->mntpoint); out_wh: free(wh); return -1;