chiark / gitweb /
core: free word later in parse_proc_cmdline
[elogind.git] / src / core / main.c
index 6e8f21a290b33d50017cf33c6056226dbbf6fa5b..12af3cdd270bab97d255c3a7c7ac9d188413391b 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;
@@ -1512,7 +1513,7 @@ int main(int argc, char *argv[]) {
                 if (prctl(PR_SET_CHILD_SUBREAPER, 1) < 0) {
                         log_warning("Failed to make us a subreaper: %m");
                         if (errno == EINVAL)
-                                log_info("Perhaps the kernel version is too old (< 3.3?)");
+                                log_info("Perhaps the kernel version is too old (< 3.4?)");
                 }
         }