summaryrefslogtreecommitdiffstats
path: root/disk-utils/fdformat.c
diff options
context:
space:
mode:
authorCristian Rodríguez2009-10-04 22:08:49 +0200
committerKarel Zak2009-10-06 10:26:04 +0200
commit4629c03d34109812af4dff03f8b65dedd474270a (patch)
tree2ee90b9eb67c966001551d08614c3cd170b38213 /disk-utils/fdformat.c
parentlibblkid: fix buffer usage in FAT prober (diff)
downloadkernel-qcow2-util-linux-4629c03d34109812af4dff03f8b65dedd474270a.tar.gz
kernel-qcow2-util-linux-4629c03d34109812af4dff03f8b65dedd474270a.tar.xz
kernel-qcow2-util-linux-4629c03d34109812af4dff03f8b65dedd474270a.zip
fdformat: fix memory leak in verify_disk()
Signed-off-by: Cristian Rodríguez <crrodriguez@opensuse.org>
Diffstat (limited to 'disk-utils/fdformat.c')
-rw-r--r--disk-utils/fdformat.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/disk-utils/fdformat.c b/disk-utils/fdformat.c
index 49809fa91..4bbb57430 100644
--- a/disk-utils/fdformat.c
+++ b/disk-utils/fdformat.c
@@ -72,6 +72,7 @@ static void verify_disk(char *name)
fprintf(stderr,
_("Problem reading cylinder %d, expected %d, read %d\n"),
cyl, cyl_size, read_bytes);
+ free(data);
exit(1);
}
for (count = 0; count < cyl_size; count++)
@@ -81,6 +82,7 @@ static void verify_disk(char *name)
break;
}
}
+ free(data);
printf(_("done\n"));
if (close(fd) < 0) PERROR("close");
}