]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprogs: free bp in xlog_find_zeroed() error path
authorEric Sandeen <sandeen@redhat.com>
Thu, 1 Aug 2013 01:32:30 +0000 (01:32 +0000)
committerMark Tinguely <tinguely@eagdhcp-232-140.americas.sgi.com>
Fri, 9 Aug 2013 13:23:47 +0000 (08:23 -0500)
xlog_find_zeroed() currently leaks a bp on one error path.

Using the bp_err: target resolves this.

Found by Coverity.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
libxlog/xfs_log_recover.c

index 7f5a41c67ae8b4495c9e50861f1cde7993334808..4093ddcf4636564456ec848ea79bdcf060644e60 100644 (file)
@@ -937,7 +937,8 @@ xlog_find_zeroed(
                 */
                xfs_warn(log->l_mp,
                        "Log inconsistent or not a log (last==0, first!=1)");
-               return XFS_ERROR(EINVAL);
+               error = XFS_ERROR(EINVAL);
+               goto bp_err;
        }
 
        /* we have a partially zeroed log */