diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-09-28 15:41:20 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-09-28 15:41:20 +0200 |
commit | 80d1c5988bfd804bc9494a33a5db5a16609cdb48 (patch) | |
tree | e9cb71c24ddccf1ebdd78a27958fedac08db1be7 /src | |
parent | 1845fdd967d3a4c06f895413505de3c2429955b0 (diff) |
journald: close sd_journal context after flushing to /var
Diffstat (limited to 'src')
-rw-r--r-- | src/journal/journald.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/journal/journald.c b/src/journal/journald.c index 3267fffed9..a1506b2374 100644 --- a/src/journal/journald.c +++ b/src/journal/journald.c @@ -896,10 +896,9 @@ static int system_journal_open(Server *s) { } static int server_flush_to_var(Server *s) { - Object *o = NULL; int r; sd_id128_t machine; - sd_journal *j; + sd_journal *j = NULL; assert(s); @@ -930,6 +929,7 @@ static int server_flush_to_var(Server *s) { } SD_JOURNAL_FOREACH(j) { + Object *o = NULL; JournalFile *f; f = j->current_file; @@ -967,6 +967,9 @@ finish: if (r >= 0) rm_rf("/run/log/journal", false, true, false); + if (j) + sd_journal_close(j); + return r; } |