1
1
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:
Lennart Poettering 2012-01-14 01:54:02 +01:00
parent 5c3759bf8a
commit 4c7de07481

View File

@ -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;