From: Luca Boccassi Date: Fri, 10 Jul 2026 15:09:49 +0000 (+0100) Subject: journal-remote: zero-initialize MHD daemon wrapper X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14830891f33d0c947c5b8f5ebc405fc45a6caaa4;p=thirdparty%2Fsystemd.git journal-remote: zero-initialize MHD daemon wrapper MHDDaemonWrapper_free() unconditionally unrefs both event sources, but setup_microhttpd_server() could return before initializing either pointer. Zero-initialize the wrapper so cleanup after MHD startup failures safely unrefs NULL. Follow-up for 3c67c8bd4c5784bbcc644e489b9a39c0d2bc0e42 --- diff --git a/src/journal-remote/journal-remote-main.c b/src/journal-remote/journal-remote-main.c index 504471fc8af..afa4e55edfc 100644 --- a/src/journal-remote/journal-remote-main.c +++ b/src/journal-remote/journal-remote-main.c @@ -532,8 +532,9 @@ static int setup_microhttpd_server(RemoteServer *s, d = new(MHDDaemonWrapper, 1); if (!d) return log_oom(); - - d->fd = (uint64_t) fd; + *d = (MHDDaemonWrapper) { + .fd = (uint64_t) fd, + }; d->daemon = sym_MHD_start_daemon( flags,