From: Mike Yuan Date: Tue, 13 May 2025 20:54:10 +0000 (+0200) Subject: journal: do not clear individual fields if the struct won't be reused X-Git-Tag: v258-rc1~627^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2627c8e79e23252dc786acb7b3eb6a54a2b7aef5;p=thirdparty%2Fsystemd.git journal: do not clear individual fields if the struct won't be reused Especially that only some of the fields are cleared currently. --- diff --git a/src/journal/journalctl-show.c b/src/journal/journalctl-show.c index d4a7c730c58..f2b43a7f3e9 100644 --- a/src/journal/journalctl-show.c +++ b/src/journal/journalctl-show.c @@ -35,8 +35,8 @@ typedef struct Context { static void context_done(Context *c) { assert(c); - c->synchronize_varlink = sd_varlink_flush_close_unref(c->synchronize_varlink); - c->event = sd_event_unref(c->event); + sd_varlink_flush_close_unref(c->synchronize_varlink); + sd_event_unref(c->event); sd_journal_close(c->journal); } diff --git a/src/journal/journald-sync.c b/src/journal/journald-sync.c index c3b8de74129..e3b28f77f03 100644 --- a/src/journal/journald-sync.c +++ b/src/journal/journald-sync.c @@ -138,7 +138,7 @@ SyncReq* sync_req_free(SyncReq *req) { LIST_REMOVE(pending_rqlen, req->server->sync_req_pending_rqlen, req); } - req->idle_event_source = sd_event_source_disable_unref(req->idle_event_source); + sd_event_source_disable_unref(req->idle_event_source); sd_varlink_unref(req->link);