chiark / gitweb /
util: simplify proc_cmdline() to reuse get_process_cmdline()
[elogind.git] / src / shared / conf-parser.c
index cd189adfc3e9813b5af2fa327d761941662736eb..ee6de653e13286220202f067485e2e70cdbeea1c 100644 (file)
@@ -710,6 +710,7 @@ int config_parse_strv(const char *unit,
 
                 if (!utf8_is_valid(n)) {
                         log_invalid_utf8(unit, LOG_ERR, filename, line, EINVAL, rvalue);
+                        free(n);
                         continue;
                 }
 
@@ -717,6 +718,9 @@ int config_parse_strv(const char *unit,
                 if (r < 0)
                         return log_oom();
         }
+        if (!isempty(state))
+                log_syntax(unit, LOG_ERR, filename, line, EINVAL,
+                           "Trailing garbage, ignoring.");
 
         return 0;
 }