diff options
Diffstat (limited to 'src/journal-remote/journal-gatewayd.c')
-rw-r--r-- | src/journal-remote/journal-gatewayd.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/journal-remote/journal-gatewayd.c b/src/journal-remote/journal-gatewayd.c index 9a09f401e0..4e5572db0b 100644 --- a/src/journal-remote/journal-gatewayd.c +++ b/src/journal-remote/journal-gatewayd.c @@ -103,11 +103,9 @@ static void request_meta_free( if (!m) return; - if (m->journal) - sd_journal_close(m->journal); + sd_journal_close(m->journal); - if (m->tmp) - fclose(m->tmp); + safe_fclose(m->tmp); free(m->cursor); free(m); @@ -338,10 +336,8 @@ static int request_parse_range( return -ENOMEM; m->cursor[strcspn(m->cursor, WHITESPACE)] = 0; - if (isempty(m->cursor)) { - free(m->cursor); - m->cursor = NULL; - } + if (isempty(m->cursor)) + m->cursor = mfree(m->cursor); return 0; } @@ -797,7 +793,7 @@ static int request_handler_machine( "\"cutoff_to_realtime\" : \"%"PRIu64"\" }\n", SD_ID128_FORMAT_VAL(mid), SD_ID128_FORMAT_VAL(bid), - hostname_cleanup(hostname, false), + hostname_cleanup(hostname), os_name ? os_name : "Linux", v ? v : "bare", usage, |