From: reverendhomer Date: Thu, 1 Oct 2015 09:09:00 +0000 (+0300) Subject: systemctl: fix memory leak in systemctl_parse_argv X-Git-Tag: v227~42^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1434%2Fhead;p=thirdparty%2Fsystemd.git systemctl: fix memory leak in systemctl_parse_argv This commit fixes Coverity #1325228 --- diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 6d33badba48..0615dd6aa5f 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -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)