Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
IPTV: m3u parser - fix wrong free
  • Loading branch information
perexg committed Oct 30, 2015
1 parent 8f95863 commit 48f04e3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/input/mpegts/iptv/iptv_http.c
Expand Up @@ -133,7 +133,7 @@ iptv_http_complete
( http_client_t *hc )
{
iptv_mux_t *im = hc->hc_aux;
char *url, sbuf[512], *s, *p;
char *url, *url2, *s, *p;
url_t u;
int r;

Expand All @@ -153,13 +153,16 @@ iptv_http_complete
*p = '\0';
if (!urlparse(s, &u))
goto invalid;
url2 = malloc(512);
url2[0] = '\0';
if ((s = http_arg_get(&hc->hc_args, "Host")) != NULL) {
snprintf(sbuf, sizeof(sbuf), "%s://%s%s",
snprintf(url2, 512, "%s://%s%s",
hc->hc_ssl ? "https" : "http", s, url);
} else if (im->mm_iptv_url_raw) {
snprintf(sbuf, sizeof(sbuf), "%s%s", s, url);
snprintf(url2, 512, "%s%s", s, url);
}
url = sbuf;
free(url);
url = url2;
urlinit(&u);
}
if (!urlparse(url, &u)) {
Expand Down

0 comments on commit 48f04e3

Please sign in to comment.