From 30f33b1b1d1bcb36af55298c6343e6c3fcac539e Mon Sep 17 00:00:00 2001 From: hgy59 Date: Sun, 22 May 2022 20:56:49 +0200 Subject: [PATCH] mdns_init: avoid null reference access - when avahi client creation fails with mdns_client=null, use avahi_strerror(error) instead of MDNSERR to avoid access to mdns_client->error. --- src/mdns_avahi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mdns_avahi.c b/src/mdns_avahi.c index 60f1dacd..5059e83e 100644 --- a/src/mdns_avahi.c +++ b/src/mdns_avahi.c @@ -1044,7 +1044,7 @@ mdns_init(void) client_callback, NULL, &error); if (!mdns_client) { - DPRINTF(E_WARN, L_MDNS, "mdns_init: Could not create Avahi client: %s\n", MDNSERR); + DPRINTF(E_WARN, L_MDNS, "mdns_init: Could not create Avahi client: %s\n", avahi_strerror(error)); return -1; }