]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: fix memory leak in systemctl_parse_argv 1434/head
authorreverendhomer <mk.43.ecko@gmail.com>
Thu, 1 Oct 2015 09:09:00 +0000 (12:09 +0300)
committerreverendhomer <mk.43.ecko@gmail.com>
Thu, 1 Oct 2015 09:09:00 +0000 (12:09 +0300)
This commit fixes Coverity #1325228

src/systemctl/systemctl.c

index 6d33badba48f0becf50e4cd089cb705212d8bed4..0615dd6aa5fe4c8fbf078da7f40a92690bb76927 100644 (file)
@@ -6860,7 +6860,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
                         size_t size;
 
                         FOREACH_WORD_SEPARATOR(word, size, optarg, ",", state) {
-                                char *s;
+                                _cleanup_free_ char *s = NULL;
 
                                 s = strndup(word, size);
                                 if (!s)