From: Jaroslav Kysela Date: Mon, 4 Jan 2016 21:10:55 +0000 (+0100) Subject: api epg: fix api_epg_grid query - eq.lang must be allocated X-Git-Tag: v4.2.1~1223 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4631e91670398f29f06df7a1491fca9daaafc01c;p=thirdparty%2Ftvheadend.git api epg: fix api_epg_grid query - eq.lang must be allocated --- diff --git a/src/api/api_epg.c b/src/api/api_epg.c index 6d63c011d..8041ccc21 100644 --- a/src/api/api_epg.c +++ b/src/api/api_epg.c @@ -297,7 +297,9 @@ api_epg_grid memset(&eq, 0, sizeof(eq)); - eq.lang = lang = access_get_lang(perm, htsmsg_get_str(args, "lang")); + lang = access_get_lang(perm, htsmsg_get_str(args, "lang")); + if (lang) + eq.lang = strdup(lang); str = htsmsg_get_str(args, "title"); if (str) eq.stitle = strdup(str); @@ -443,6 +445,7 @@ api_epg_grid pthread_mutex_unlock(&global_lock); epg_query_free(&eq); + free(lang); /* Build response */ *resp = htsmsg_create_map();