diff --git a/src/htsmsg.c b/src/htsmsg.c index 935c30b6..90f4e4eb 100644 --- a/src/htsmsg.c +++ b/src/htsmsg.c @@ -703,13 +703,4 @@ htsmsg_get_cdata(htsmsg_t *m, const char *field) } -/** - * - */ -void -htsmsg_dtor(htsmsg_t **mp) -{ - if(*mp != NULL) - htsmsg_destroy(*mp); -} diff --git a/src/htsmsg.h b/src/htsmsg.h index 82fb7fda..8343634f 100644 --- a/src/htsmsg.h +++ b/src/htsmsg.h @@ -320,6 +320,3 @@ htsmsg_t *htsmsg_get_map_by_field_if_name(htsmsg_field_t *f, const char *name); const char *htsmsg_get_cdata(htsmsg_t *m, const char *field); -extern void htsmsg_dtor(htsmsg_t **mp); - -#define htsmsg_autodtor(n) htsmsg_t *n __attribute__((cleanup(htsmsg_dtor))) diff --git a/src/webui/extjs.c b/src/webui/extjs.c index ca987e94..bf254d03 100644 --- a/src/webui/extjs.c +++ b/src/webui/extjs.c @@ -470,10 +470,10 @@ extjs_channels(http_connection_t *hc, const char *remain, void *opaque) if(op == NULL) return 400; - htsmsg_autodtor(in) = + htsmsg_t *in = entries != NULL ? htsmsg_json_deserialize(entries) : NULL; - htsmsg_autodtor(out) = htsmsg_create_map(); + htsmsg_t *out = htsmsg_create_map(); scopedgloballock(); @@ -497,11 +497,15 @@ extjs_channels(http_connection_t *hc, const char *remain, void *opaque) extjs_channels_update(in); } else { + htsmsg_destroy(in); + htsmsg_destroy(out); return 400; } htsmsg_json_serialize(out, hq, 0); http_output_content(hc, "text/x-json; charset=UTF-8"); + htsmsg_destroy(in); + htsmsg_destroy(out); return 0; }