From: Dave Chinner Date: Wed, 29 Jun 2016 01:13:02 +0000 (+1000) Subject: libxfs: fix double free in libxfs_alloc_file_space X-Git-Tag: v4.7.0-rc2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3fbf002a6eb62841a3fa05bc2ce98c98722b660c;p=thirdparty%2Fxfsprogs-dev.git libxfs: fix double free in libxfs_alloc_file_space When porting the transaction alocation interface to userspace (commit 9074815), I missed a change in libxfs_alloc_file_space() that could lead to a double free of a transaction pointer in an error path. Coverity spotted it, so fix it. Coverity-id: 1362811 Signed-off-by: Dave Chinner --- diff --git a/libxfs/util.c b/libxfs/util.c index 37941246e..90eaf41c8 100644 --- a/libxfs/util.c +++ b/libxfs/util.c @@ -548,11 +548,7 @@ libxfs_alloc_file_space( * Check for running out of space */ if (error) { - /* - * Free the transaction structure. - */ ASSERT(error == -ENOSPC); - xfs_trans_cancel(tp); break; } xfs_trans_ijoin(tp, ip, 0);