From: Lennart Poettering Date: Sun, 31 Jan 2016 22:55:06 +0000 (+0100) Subject: journal-cat: don't allocate memory for the syslog identifier X-Git-Tag: v231~691^2~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2afcd6902b5c04e8b05c9d1ffd8bc6175fac6efb;p=platform%2Fupstream%2Fsystemd.git journal-cat: don't allocate memory for the syslog identifier Fixes: #2490 --- diff --git a/src/journal/cat.c b/src/journal/cat.c index 7fd4198..07c3df5 100644 --- a/src/journal/cat.c +++ b/src/journal/cat.c @@ -34,7 +34,7 @@ #include "syslog-util.h" #include "util.h" -static char *arg_identifier = NULL; +static const char *arg_identifier = NULL; static int arg_priority = LOG_INFO; static bool arg_level_prefix = true; @@ -82,14 +82,10 @@ static int parse_argv(int argc, char *argv[]) { return version(); case 't': - free(arg_identifier); if (isempty(optarg)) arg_identifier = NULL; - else { - arg_identifier = strdup(optarg); - if (!arg_identifier) - return log_oom(); - } + else + arg_identifier = optarg; break; case 'p':