Browse Source

Merge pull request #1074 from monkey/duda

Duda: delete JSON tree context after format
Hamilton Turner 11 years ago
parent
commit
703c1e0220
1 changed files with 3 additions and 0 deletions
  1. 3 0
      frameworks/C/duda/webservice/main.c

+ 3 - 0
frameworks/C/duda/webservice/main.c

@@ -42,6 +42,9 @@ void cb_json(duda_request_t *dr)
     body = json->print_unformatted_gc(dr, j_root);
     body = json->print_unformatted_gc(dr, j_root);
     body_len = strlen(body);
     body_len = strlen(body);
 
 
+    /* Delete the JSON tree */
+    json->delete(j_root);
+
     /* Compose the response */
     /* Compose the response */
     response->http_status(dr, 200);
     response->http_status(dr, 200);
     response->http_header_n(dr, JSON_CONTENT_TYPE, sizeof(JSON_CONTENT_TYPE) - 1);
     response->http_header_n(dr, JSON_CONTENT_TYPE, sizeof(JSON_CONTENT_TYPE) - 1);