OSDN Git Service

* parted/ui.c (non_interactive_mode): Plug a tiny leak.
authorJim Meyering <jim@meyering.net>
Thu, 8 Mar 2007 21:39:33 +0000 (22:39 +0100)
committerJim Meyering <jim@meyering.net>
Thu, 8 Mar 2007 21:39:33 +0000 (22:39 +0100)
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".

parted/ui.c

index 6bf770a..59cb98b 100644 (file)
@@ -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;