diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-01-31 23:55:06 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-02-01 22:18:15 +0100 |
commit | 2afcd6902b5c04e8b05c9d1ffd8bc6175fac6efb (patch) | |
tree | fa76e393572082d5e0cd45415cb77dad61b4d6ad /src/journal | |
parent | 7e0cdf8f1ff366a1d1770ea92bcce686db8c2dfc (diff) |
journal-cat: don't allocate memory for the syslog identifier
Fixes: #2490
Diffstat (limited to 'src/journal')
-rw-r--r-- | src/journal/cat.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/journal/cat.c b/src/journal/cat.c index 7fd4198df8..07c3df522c 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': |