]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_logprint: Fix error handling in xlog_print_trans_efi
authorEric Sandeen <sandeen@sandeen.net>
Thu, 1 May 2014 23:32:33 +0000 (09:32 +1000)
committerDave Chinner <david@fromorbit.com>
Thu, 1 May 2014 23:32:33 +0000 (09:32 +1000)
A recent change to xlog_print_trans_efi() led to a leaked
"src_f" on this error return.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
logprint/log_misc.c

index 928f60a52533ad501f5d458f520ebadd63101db5..d482cf3fba575e7faf46127278274a11d903eb9a 100644 (file)
@@ -482,7 +482,7 @@ xlog_print_trans_efi(
        uint src_len,
        int continued)
 {
-    xfs_efi_log_format_t *src_f, *f;
+    xfs_efi_log_format_t *src_f, *f = NULL;
     uint                dst_len;
     xfs_extent_t        *ex;
     int                         i;
@@ -505,7 +505,8 @@ xlog_print_trans_efi(
 
     if (continued && src_len < core_size) {
        printf(_("EFI: Not enough data to decode further\n"));
-       return 1;
+       error = 1;
+       goto error;
     }
 
     if ((f = (xfs_efi_log_format_t *)malloc(dst_len)) == NULL) {