kopia lustrzana https://gitlab.com/sane-project/backends
Fix potential assert in avahi backend
avahi_browser contains a reference to an AvahiClient, which may be avahi_client. If it does, then freeing avahi_browser references avahi_client, resulting in an assert() in Avahi's linked list macro. Fix this by freeing avahi_browser before avahi_client. See https://bugs.launchpad.net/bugs/831867merge-requests/1/head
rodzic
e6711c377f
commit
77dcf26860
|
@ -846,15 +846,15 @@ net_avahi_callback (AvahiClient *c, AvahiClientState state, void * userdata)
|
|||
if (error == AVAHI_ERR_DISCONNECTED)
|
||||
{
|
||||
/* Server disappeared - try to reconnect */
|
||||
avahi_client_free (avahi_client);
|
||||
avahi_client = NULL;
|
||||
|
||||
if (avahi_browser)
|
||||
{
|
||||
avahi_service_browser_free (avahi_browser);
|
||||
avahi_browser = NULL;
|
||||
}
|
||||
|
||||
avahi_client_free (avahi_client);
|
||||
avahi_client = NULL;
|
||||
|
||||
avahi_client = avahi_client_new (avahi_threaded_poll_get (avahi_thread), AVAHI_CLIENT_NO_FAIL, net_avahi_callback, NULL, &error);
|
||||
if (avahi_client == NULL)
|
||||
{
|
||||
|
|
Ładowanie…
Reference in New Issue