[parted-devel] plug a ui-leak

Jim Meyering jim at meyering.net
Thu Mar 8 22:30:43 CET 2007


This is trivial:

	* parted/ui.c (non_interactive_mode): Plug a tiny leak.
	Exercise by running the following with a CD-ROM in the drive:
	valgrind --leak-check=full parted/parted /dev/cdrom print
	Before, we'd leak the 6-byte command: "print\0".

diff --git a/parted/ui.c b/parted/ui.c
index 6bf770a..59cb98b 100644
--- a/parted/ui.c
+++ b/parted/ui.c
@@ -1511,6 +1511,7 @@ non_interactive_mode (PedDevice** dev, Command* cmd_list[],
                         break;

                 cmd = command_get (commands, word);
+                free (word);
                 if (!cmd) {
                         help_msg ();
                         goto error;



More information about the parted-devel mailing list