mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-12 09:17:44 +03:00
journal: handle empty syslog identifier properly
This commit is contained in:
parent
5c3759bf8a
commit
4c7de07481
@ -1405,10 +1405,14 @@ static int stdout_stream_line(StdoutStream *s, char *p) {
|
||||
switch (s->state) {
|
||||
|
||||
case STDOUT_STREAM_IDENTIFIER:
|
||||
s->identifier = strdup(p);
|
||||
if (!s->identifier) {
|
||||
log_error("Out of memory");
|
||||
return -ENOMEM;
|
||||
if (isempty(p))
|
||||
s->identifier = NULL;
|
||||
else {
|
||||
s->identifier = strdup(p);
|
||||
if (!s->identifier) {
|
||||
log_error("Out of memory");
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
|
||||
s->state = STDOUT_STREAM_PRIORITY;
|
||||
|
Loading…
Reference in New Issue
Block a user