summaryrefslogtreecommitdiff
path: root/resize
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2009-07-02 13:54:22 -0400
committerTheodore Ts'o <tytso@mit.edu>2009-07-02 13:54:22 -0400
commit3a4d9869d47c462c84688b0f8b15df5ab6f93381 (patch)
tree027ba2aa16a07ba901b7c40d5d77138f3c6ca881 /resize
parent7ad8da364950fd21aceb3c0a5785fda245036650 (diff)
downloade2fsprogs-3a4d9869d47c462c84688b0f8b15df5ab6f93381.tar.gz
resize2fs: Fix error message so the mountpoint is printed correctly
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>
Diffstat (limited to 'resize')
-rw-r--r--resize/main.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/resize/main.c b/resize/main.c
index 9b03ba92..2dae161b 100644
--- a/resize/main.c
+++ b/resize/main.c
@@ -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);