]> git.meshlink.io Git - catta/commitdiff
* fix a bug with bad collision handling in static services (Thanks Sebest!)
authorLennart Poettering <lennart@poettering.net>
Sun, 21 Aug 2005 12:54:35 +0000 (12:54 +0000)
committerLennart Poettering <lennart@poettering.net>
Sun, 21 Aug 2005 12:54:35 +0000 (12:54 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@378 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-daemon/static-services.c

index f6aa193f55558c208554114e2e2772216d399bc4..e402a9853de94b07c70118e340b5d25554718282 100644 (file)
@@ -201,14 +201,15 @@ static void add_static_service_group_to_server(StaticServiceGroup *g) {
         /* This service group is already registered in the server */
         return;
     
-    if (g->chosen_name)
-        avahi_free(g->chosen_name);
-    
-    if (g->replace_wildcards)
-        g->chosen_name = replacestr(g->name, "%h", avahi_server_get_host_name(avahi_server));
-    else
-        g->chosen_name = avahi_strdup(g->name);
+    if (!g->chosen_name) {
+        
+        if (g->replace_wildcards)
+            g->chosen_name = replacestr(g->name, "%h", avahi_server_get_host_name(avahi_server));
+        else
+            g->chosen_name = avahi_strdup(g->name);
 
+    }
+        
     if (!g->entry_group)
         g->entry_group = avahi_s_entry_group_new(avahi_server, entry_group_callback, g);