]> err.no Git - util-linux/commitdiff
fdformat: fix memory leak in verify_disk()
authorCristian Rodríguez <crrodriguez@opensuse.org>
Sun, 4 Oct 2009 20:08:49 +0000 (16:08 -0400)
committerKarel Zak <kzak@redhat.com>
Mon, 30 Nov 2009 15:23:17 +0000 (16:23 +0100)
Signed-off-by: Cristian Rodríguez <crrodriguez@opensuse.org>
disk-utils/fdformat.c

index 49809fa9157bb207f359633e9e968db45532af70..4bbb574309d3585515483afcb3a307f37e080db8 100644 (file)
@@ -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");
 }