[PATCH] Fix memory leak in verify_disk()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Cristian Rodríguez <crrodriguez@xxxxxxxxxxxx>
---
 disk-utils/fdformat.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/disk-utils/fdformat.c b/disk-utils/fdformat.c
index 49809fa..4bbb574 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");
 }
-- 
1.6.4.2

--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux