]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
api epg: fix api_epg_grid query - eq.lang must be allocated
authorJaroslav Kysela <perex@perex.cz>
Mon, 4 Jan 2016 21:10:55 +0000 (22:10 +0100)
committerJaroslav Kysela <perex@perex.cz>
Mon, 4 Jan 2016 21:12:02 +0000 (22:12 +0100)
src/api/api_epg.c

index 6d63c011d22055eb60329f3730c5a470a415e557..8041ccc2120738f824042244e989117594251b6b 100644 (file)
@@ -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();