From: Jaroslav Kysela Date: Mon, 9 Oct 2017 14:24:07 +0000 (+0200) Subject: main: fix the empty webroot handling X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=93c00e5f7f996776cc1782c13af1cccdec4e6f58;p=thirdparty%2Ftvheadend.git main: fix the empty webroot handling --- diff --git a/src/main.c b/src/main.c index 93039634b..ad5f911b6 100644 --- a/src/main.c +++ b/src/main.c @@ -1000,7 +1000,10 @@ main(int argc, char **argv) } if (tmp[strlen(tmp)-1] == '/') tmp[strlen(tmp)-1] = '\0'; - tvheadend_webroot = tmp; + if (tmp[0]) + tvheadend_webroot = tmp; + else + free(tmp); } tvheadend_webui_debug = opt_uidebug; @@ -1371,6 +1374,7 @@ main(int argc, char **argv) if (opt_dbus) dbus_shutdown(); #endif tvh_gettext_done(); + free((char *)tvheadend_webroot); return 0; }