diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-01-16 10:15:02 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-01-23 18:16:13 +0000 |
commit | ab1bb725265ea212e89320f4bbbad9a2c6488cb9 (patch) | |
tree | 431ea1e8c88df48bba644bcbd2d805ea69f538f2 | |
parent | 9e27ff8ed659380e2a3aad8a052fe229b2f2bd5f (diff) | |
download | libguestfs-ab1bb725265ea212e89320f4bbbad9a2c6488cb9.tar.gz libguestfs-ab1bb725265ea212e89320f4bbbad9a2c6488cb9.tar.xz libguestfs-ab1bb725265ea212e89320f4bbbad9a2c6488cb9.zip |
resize2fs-M: fix double-free along error path (thanks Matthew Booth).
(cherry picked from commit b1ea8a7808744068fe0d1306d1005e841a570b4c)
-rw-r--r-- | daemon/ext2.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/daemon/ext2.c b/daemon/ext2.c index f3d23300..d85c9fd4 100644 --- a/daemon/ext2.c +++ b/daemon/ext2.c @@ -277,12 +277,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; } |