summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-08-21 12:54:35 +0000
committerLennart Poettering <lennart@poettering.net>2005-08-21 12:54:35 +0000
commit2cd808afb7c008600fd4384446adb3d52b4651f2 (patch)
treec1fedf20c4b013c5eaab4d70dc7ec0d7693fcb4a
parentfd9cf36863e25d1094d78f4c51a6b31799798f60 (diff)
* fix a bug with bad collision handling in static services (Thanks Sebest!)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@378 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
-rw-r--r--avahi-daemon/static-services.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/avahi-daemon/static-services.c b/avahi-daemon/static-services.c
index f6aa193..e402a98 100644
--- a/avahi-daemon/static-services.c
+++ b/avahi-daemon/static-services.c
@@ -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);