]> git.meshlink.io Git - catta/commitdiff
Fix a segfault when registering services with libdns_sd before the avahi daemon finis...
authorLennart Poettering <lennart@poettering.net>
Thu, 6 Sep 2007 17:20:03 +0000 (17:20 +0000)
committerLennart Poettering <lennart@poettering.net>
Thu, 6 Sep 2007 17:20:03 +0000 (17:20 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1536 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-compat-libdns_sd/compat.c

index 36bb84a5784407afbe2d03cdaf4467a31211d945..7c2686a72c9a682727b6da5bc63a9b0c72ae5b87 100644 (file)
@@ -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 */