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 3c67c8bd4c
This commit is contained in:
Luca Boccassi
2026-07-15 21:13:24 +01:00
parent 16c6758eb4
commit 14830891f3
+3 -2
View File
@@ -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,