lib/avahi/Client: free the AvahiClient on AVAHI_CLIENT_FAILURE

Previously the AvahiClient was only freed when AVAHI_ERR_DISCONNECTED
was detected, but all other error conditions would lead to a memory
leak.
This commit is contained in:
Max Kellermann 2024-01-17 18:37:39 +01:00 committed by Max Kellermann
parent f85629afa6
commit 9a7a49350c

View File

@ -57,6 +57,8 @@ Client::ClientCallback(AvahiClient *c, AvahiClientState state) noexcept
reconnect_timer.Schedule(std::chrono::seconds(10));
} else {
Close();
if (!error_handler.OnAvahiError(std::make_exception_ptr(MakeError(error,
"Avahi connection error"))))
return;