journal-remote: destroy event sources before MHD context

The MHD context owns the fd we watch via our event source, hence when we
destroy the context before the event source the event source might still
reference the fd that is now invalid. Hence swap the order.
This commit is contained in:
Lennart Poettering
2025-05-13 15:39:57 +02:00
parent f9b186c21a
commit 6f77c31f63
+3 -2
View File
@@ -98,10 +98,11 @@ static MHDDaemonWrapper* MHDDaemonWrapper_free(MHDDaemonWrapper *d) {
if (!d)
return NULL;
d->io_event = sd_event_source_unref(d->io_event);
d->timer_event = sd_event_source_unref(d->timer_event);
if (d->daemon)
MHD_stop_daemon(d->daemon);
sd_event_source_unref(d->io_event);
sd_event_source_unref(d->timer_event);
return mfree(d);
}