From 4629c03d34109812af4dff03f8b65dedd474270a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Cristian=20Rodr=C3=ADguez?= Date: Sun, 4 Oct 2009 16:08:49 -0400 Subject: [PATCH] fdformat: fix memory leak in verify_disk() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Cristian Rodríguez --- disk-utils/fdformat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/disk-utils/fdformat.c b/disk-utils/fdformat.c index 49809fa9..4bbb5743 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"); } -- 2.39.5