]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: fix double free in libxfs_alloc_file_space
authorDave Chinner <david@fromorbit.com>
Wed, 29 Jun 2016 01:13:02 +0000 (11:13 +1000)
committerDave Chinner <david@fromorbit.com>
Wed, 29 Jun 2016 01:13:02 +0000 (11:13 +1000)
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 <david@fromorbit.com>
libxfs/util.c

index 37941246eb5dc97acb513be216053dbd20f72595..90eaf41c8ea388a61bef7cd56509a4fe44d58aef 100644 (file)
@@ -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);