Refactor TR_FILTER using a GPtrArray of filter lines
[trust_router.git] / common / tr_constraint.c
index 7c8676c..da5f42e 100644 (file)
  *
  */
 #include <jansson.h>
+#if JANSSON_VERSION_HEX < 0x020500
 #include "jansson_iterators.h"
+#endif
 #include <assert.h>
 #include <talloc.h>
 
-#include <tr_filter.h>
-#include <tr_debug.h>
-
 #include <trust_router/tr_constraint.h>
+#include <tr_filter.h>
 #include <tid_internal.h>
+#include <tr_debug.h>
 
 
 static int tr_constraint_destructor(void *obj)
@@ -230,7 +231,6 @@ int tr_constraint_set_validate(TR_CONSTRAINT_SET *cset) {
  * Create a new constraint set containing all constraints from #orig
  * with constraint_type #constraint_type and no others.  This constraint set is
  * live until #request is freed.
- * TODO: use or remove the request parameter.
  */
 TR_CONSTRAINT_SET *tr_constraint_set_filter(TID_REQ *request,
                                             TR_CONSTRAINT_SET *orig,
@@ -249,6 +249,7 @@ TR_CONSTRAINT_SET *tr_constraint_set_filter(TID_REQ *request,
     if (json_object_get(set_member, constraint_type))
       json_array_append(new_cs, set_member);
   }
+  tid_req_cleanup_json(request, new_cs);
   return (TR_CONSTRAINT_SET *) new_cs;
 }