]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
resize2fs: Fix error message so the mountpoint is printed correctly
authorTheodore Ts'o <tytso@mit.edu>
Thu, 2 Jul 2009 17:54:22 +0000 (13:54 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 2 Jul 2009 17:54:22 +0000 (13:54 -0400)
The resize2fs program was freeing the mountpoint information too
early, so garbage was getting printed instead of the correct
information in an error message.

Addresses-Debian-Bug: #535452

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
resize/main.c

index 9b03ba929128121b2f40ba8b332e08f8ccb088c4..2dae161b8b3f84212059110b8fd62c19d86f00c5 100644 (file)
@@ -250,10 +250,8 @@ int main (int argc, char ** argv)
                                device_name);
                        exit(1);
                }
-               if (!(mount_flags & EXT2_MF_MOUNTED) || (mtpt[len-1] == 0)) {
-                       free(mtpt);
+               if (!(mount_flags & EXT2_MF_MOUNTED) || (mtpt[len-1] == 0))
                        break;
-               }
                free(mtpt);
                len = 2 * len;
        }
@@ -453,6 +451,7 @@ int main (int argc, char ** argv)
                                   ((flags & RESIZE_PERCENT_COMPLETE) ?
                                    resize_progress_func : 0));
        }
+       free(mtpt);
        if (retval) {
                com_err(program_name, retval, _("while trying to resize %s"),
                        device_name);