]> err.no Git - systemd/commitdiff
journal: handle empty syslog identifier properly
authorLennart Poettering <lennart@poettering.net>
Sat, 14 Jan 2012 00:54:02 +0000 (01:54 +0100)
committerLennart Poettering <lennart@poettering.net>
Sat, 14 Jan 2012 00:54:33 +0000 (01:54 +0100)
src/journal/journald.c

index 39263bfe4c41530e9431396f91886b4f68d95cba..f63a12fae86b656291a383152943b2337ef4afa7 100644 (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;