]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
api idnode: fix compilation error and memory leak
authorJaroslav Kysela <perex@perex.cz>
Mon, 5 Dec 2016 19:34:04 +0000 (20:34 +0100)
committerJaroslav Kysela <perex@perex.cz>
Mon, 5 Dec 2016 19:34:04 +0000 (20:34 +0100)
src/api/api_idnode.c

index bbc0dd7dc718f0fa5a616be66bc6a85712887387..297069f3e6d0a7310f1d518162fdd548c6273988 100644 (file)
@@ -734,11 +734,13 @@ api_idnode_create( htsmsg_t **resp, idnode_t *in )
 void
 api_idnode_create_list( htsmsg_t **resp, htsmsg_t *list )
 {
-  if (list == NULL)
+  if (list == NULL) {
+    htsmsg_destroy(list);
     return;
+  }
   if (*resp == NULL)
     *resp = htsmsg_create_map();
-  htsmsg_add_str(*resp, "uuid", list);
+  htsmsg_add_msg(*resp, "uuid", list);
 }
 
 void api_idnode_init ( void )