From: Lennart Poettering Date: Mon, 25 Nov 2019 17:44:19 +0000 (+0100) Subject: journalctl: use automatic memory cleanup X-Git-Tag: v245-rc1~41^2~27 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e7238caf0cf53555e2e858150c543bd802fd28f5;p=thirdparty%2Fsystemd.git journalctl: use automatic memory cleanup --- diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index d8376300079..3ab79d11a51 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -767,7 +767,7 @@ static int parse_argv(int argc, char *argv[]) { dots = strstr(optarg, ".."); if (dots) { - char *a; + _cleanup_free_ char *a = NULL; int from, to, i; /* a range */ @@ -777,7 +777,6 @@ static int parse_argv(int argc, char *argv[]) { from = log_level_from_string(a); to = log_level_from_string(dots + 2); - free(a); if (from < 0 || to < 0) return log_error_errno(SYNTHETIC_ERRNO(EINVAL),