chiark / gitweb /
core: free word later in parse_proc_cmdline
authorLukas Nykryn <lnykryn@redhat.com>
Mon, 20 Aug 2012 12:52:07 +0000 (14:52 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 23 Aug 2012 11:53:30 +0000 (13:53 +0200)
src/core/main.c

index b50a1ca..12af3cd 100644 (file)
@@ -727,12 +727,13 @@ static int parse_proc_cmdline(void) {
                 }
 
                 r = parse_proc_cmdline_word(word);
-                free(word);
-
                 if (r < 0) {
                         log_error("Failed on cmdline argument %s: %s", word, strerror(-r));
+                        free(word);
                         goto finish;
                 }
+
+                free(word);
         }
 
         r = 0;