From 3fbf002a6eb62841a3fa05bc2ce98c98722b660c Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Wed, 29 Jun 2016 11:13:02 +1000 Subject: [PATCH] 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 --- libxfs/util.c | 4 ---- 1 file changed, 4 deletions(-) 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); -- 2.50.1