From b133a703cc58789194d28687df87b8a318ccfc0e Mon Sep 17 00:00:00 2001 From: jmjatlanta Date: Thu, 21 Sep 2017 15:30:23 -0500 Subject: [PATCH] fixed memory leak --- core/api.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/api.c b/core/api.c index fb9099c..06bbf1f 100644 --- a/core/api.c +++ b/core/api.c @@ -508,6 +508,7 @@ void *api_connection_thread (void *ptr) libp2p_logger_error("api", "ipfs_core_http_request_process returned false.\n"); // TODO: Handle this condition } + ipfs_core_http_request_free(http_request); snprintf(resp, sizeof(resp), "%s 200 OK\r\n" \ "Content-Type: application/json\r\n" @@ -515,6 +516,7 @@ void *api_connection_thread (void *ptr) "X-Chunked-Output: 1\r\n" "Connection: close\r\n" "Transfer-Encoding: chunked\r\n\r\n%s", req.buf + req.http_ver, response_text); + free(response_text); write_str (s, resp); libp2p_logger_error("api", "resp = {\n%s\n}\n", resp); } else {