]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
avahi: tvheadend_webroot can be NULL - fix the fix 415/head
authorDamjan Marion <damjan.marion@gmail.com>
Mon, 2 Jun 2014 16:06:26 +0000 (18:06 +0200)
committerDamjan Marion <damjan.marion@gmail.com>
Mon, 2 Jun 2014 16:06:43 +0000 (18:06 +0200)
src/avahi.c

index c1084c5eda2b38ad888364541f6224ef8b61eff9..662957ebe2a5f43bd3bff6b96cb27164f3ccea0f 100644 (file)
@@ -152,7 +152,7 @@ create_services(AvahiClient *c)
       path = malloc(strlen(tvheadend_webroot) + 6);
       sprintf(path, "path=%s", tvheadend_webroot);
     } else {
-      path = "/";
+      path = strdup("path=/");
     }
 
     /* Add the service for HTTP */
@@ -162,8 +162,7 @@ create_services(AvahiClient *c)
                                             path,
                                             NULL)) < 0) {
 
-    if (tvheadend_webroot)
-      free(path);
+    free(path);
 
       if (ret == AVAHI_ERR_COLLISION)
        goto collision;