From: Damjan Marion Date: Mon, 2 Jun 2014 16:06:26 +0000 (+0200) Subject: avahi: tvheadend_webroot can be NULL - fix the fix X-Git-Tag: v4.1~2007^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F415%2Fhead;p=thirdparty%2Ftvheadend.git avahi: tvheadend_webroot can be NULL - fix the fix --- diff --git a/src/avahi.c b/src/avahi.c index c1084c5ed..662957ebe 100644 --- a/src/avahi.c +++ b/src/avahi.c @@ -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;