summaryrefslogtreecommitdiffstats
path: root/avahi-compat-libdns_sd/compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'avahi-compat-libdns_sd/compat.c')
-rw-r--r--avahi-compat-libdns_sd/compat.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/avahi-compat-libdns_sd/compat.c b/avahi-compat-libdns_sd/compat.c
index 36bb84a..7c2686a 100644
--- a/avahi-compat-libdns_sd/compat.c
+++ b/avahi-compat-libdns_sd/compat.c
@@ -990,6 +990,16 @@ static void reg_client_callback(AvahiClient *s, AvahiClientState state, void* us
return;
}
}
+
+ if (!sdref->service_name_chosen) {
+
+ assert(sdref->service_name);
+
+ if (!(sdref->service_name_chosen = avahi_strdup(sdref->service_name))) {
+ reg_report_error(sdref, kDNSServiceErr_NoMemory);
+ return;
+ }
+ }
/* Register the service */