]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal: do not clear individual fields if the struct won't be reused
authorMike Yuan <me@yhndnzj.com>
Tue, 13 May 2025 20:54:10 +0000 (22:54 +0200)
committerMike Yuan <me@yhndnzj.com>
Tue, 13 May 2025 20:54:10 +0000 (22:54 +0200)
Especially that only some of the fields are cleared currently.

src/journal/journalctl-show.c
src/journal/journald-sync.c

index d4a7c730c58318dbd0f4eee33a6f818cd0c24a2c..f2b43a7f3e99514bd60d3081af07cf7a52394867 100644 (file)
@@ -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);
 }
 
index c3b8de7412950cc4263a850c944150a6f40fa49e..e3b28f77f0398b8df4c09efeb322673fc1145331 100644 (file)
@@ -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);