summaryrefslogtreecommitdiffstats
path: root/daemon/ext2.c
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-01-16 10:15:02 +0000
committerRichard W.M. Jones <rjones@redhat.com>2012-01-16 10:15:02 +0000
commitb1ea8a7808744068fe0d1306d1005e841a570b4c (patch)
treeb956ced964a064ca5fedb7cb80784f6938b4961c /daemon/ext2.c
parent3e9f8d050a7709ef3e9ea8c6b5098bac6fc21740 (diff)
downloadlibguestfs-b1ea8a7808744068fe0d1306d1005e841a570b4c.tar.gz
libguestfs-b1ea8a7808744068fe0d1306d1005e841a570b4c.tar.xz
libguestfs-b1ea8a7808744068fe0d1306d1005e841a570b4c.zip
resize2fs-M: fix double-free along error path (thanks Matthew Booth).
Diffstat (limited to 'daemon/ext2.c')
-rw-r--r--daemon/ext2.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/daemon/ext2.c b/daemon/ext2.c
index 2cd3da3d..a6439352 100644
--- a/daemon/ext2.c
+++ b/daemon/ext2.c
@@ -279,12 +279,10 @@ do_resize2fs_M (const char *device)
r = command (NULL, &err, prog, "-M", device, NULL);
if (r == -1) {
- if (strstr (err, "e2fsck -f")) {
- free (err);
+ if (strstr (err, "e2fsck -f"))
reply_with_error ("you need to run e2fsck with the correct and/or forceall options first");
- } else {
+ else
reply_with_error ("%s", err);
- }
free (err);
return -1;
}