mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-24 02:03:54 +03:00
journal-cat: don't allocate memory for the syslog identifier
Fixes: #2490
This commit is contained in:
parent
7e0cdf8f1f
commit
2afcd6902b
@ -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':
|
||||
|
Loading…
x
Reference in New Issue
Block a user