]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxlog: fix memory leak in xlog_recover_add_to_trans
authorEric Sandeen <sandeen@redhat.com>
Mon, 14 Apr 2014 06:12:29 +0000 (16:12 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 14 Apr 2014 06:12:29 +0000 (16:12 +1000)
Free the memory in error path of xlog_recover_add_to_trans().
Normally this memory is freed in recovery pass2, but is leaked
in the error path.

Userspace version of kernel commits 519ccb8 & aaaae98

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
libxlog/xfs_log_recover.c

index 3f22921004faa4ab244e200700e4ada71a221117..d1fa53534d0f80544940182da6a41e00b40d16d2 100644 (file)
@@ -1131,6 +1131,7 @@ xlog_recover_add_to_trans(
                "bad number of regions (%d) in inode log format",
                                  in_f->ilf_size);
                        ASSERT(0);
+                       kmem_free(ptr);
                        return XFS_ERROR(EIO);
                }