diff options
Diffstat (limited to 'src/journal-remote')
-rw-r--r-- | src/journal-remote/journal-gatewayd.c | 6 | ||||
-rw-r--r-- | src/journal-remote/journal-remote-write.c | 3 | ||||
-rw-r--r-- | src/journal-remote/journal-remote.c | 3 | ||||
-rw-r--r-- | src/journal-remote/journal-upload-journal.c | 6 |
4 files changed, 6 insertions, 12 deletions
diff --git a/src/journal-remote/journal-gatewayd.c b/src/journal-remote/journal-gatewayd.c index ebdd9edfc3..bb762c8832 100644 --- a/src/journal-remote/journal-gatewayd.c +++ b/src/journal-remote/journal-gatewayd.c @@ -337,10 +337,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; } diff --git a/src/journal-remote/journal-remote-write.c b/src/journal-remote/journal-remote-write.c index 99820fa7b8..40f4ff8e58 100644 --- a/src/journal-remote/journal-remote-write.c +++ b/src/journal-remote/journal-remote-write.c @@ -30,8 +30,7 @@ int iovw_put(struct iovec_wrapper *iovw, void* data, size_t len) { } void iovw_free_contents(struct iovec_wrapper *iovw) { - free(iovw->iovec); - iovw->iovec = NULL; + iovw->iovec = mfree(iovw->iovec); iovw->size_bytes = iovw->count = 0; } diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c index cdcda1cb52..bdf01f582c 100644 --- a/src/journal-remote/journal-remote.c +++ b/src/journal-remote/journal-remote.c @@ -88,8 +88,7 @@ static int spawn_child(const char* child, char** argv) { child_pid = fork(); if (child_pid < 0) { - r = -errno; - log_error_errno(errno, "Failed to fork: %m"); + r = log_error_errno(errno, "Failed to fork: %m"); safe_close_pair(fd); return r; } diff --git a/src/journal-remote/journal-upload-journal.c b/src/journal-remote/journal-upload-journal.c index 5fd639a76a..507210f51c 100644 --- a/src/journal-remote/journal-upload-journal.c +++ b/src/journal-remote/journal-upload-journal.c @@ -21,8 +21,7 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) { switch(u->entry_state) { case ENTRY_CURSOR: { - free(u->current_cursor); - u->current_cursor = NULL; + u->current_cursor = mfree(u->current_cursor); r = sd_journal_get_cursor(u->journal, &u->current_cursor); if (r < 0) @@ -375,10 +374,9 @@ int open_journal_for_upload(Uploader *u, if (cursor) { r = sd_journal_seek_cursor(j, cursor); - if (r < 0) { + if (r < 0) return log_error_errno(r, "Failed to seek to cursor %s: %m", cursor); - } } return process_journal_input(u, 1 + !!after_cursor); |