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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user