chiark / gitweb /
journald: fix bad memory access
authorLennart Poettering <lennart@poettering.net>
Mon, 19 Nov 2012 23:19:27 +0000 (00:19 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 19 Nov 2012 23:21:44 +0000 (00:21 +0100)
https://bugzilla.redhat.com/show_bug.cgi?id=875653

src/journal/journald-server.c

index 0ff2866..3eaf0d3 100644 (file)
@@ -336,7 +336,7 @@ void server_rotate(Server *s) {
         HASHMAP_FOREACH_KEY(f, k, s->user_journals, i) {
                 r = journal_file_rotate(&f, s->compress, s->seal);
                 if (r < 0)
         HASHMAP_FOREACH_KEY(f, k, s->user_journals, i) {
                 r = journal_file_rotate(&f, s->compress, s->seal);
                 if (r < 0)
-                        if (f->path)
+                        if (f)
                                 log_error("Failed to rotate %s: %s", f->path, strerror(-r));
                         else
                                 log_error("Failed to create user journal: %s", strerror(-r));
                                 log_error("Failed to rotate %s: %s", f->path, strerror(-r));
                         else
                                 log_error("Failed to create user journal: %s", strerror(-r));