telize

High performance JSON IP and GeoIP REST API (IP Geolocation)
Log | Files | Refs | README | LICENSE

commit fd65992c26d5c831961739ac7b0e05f07bbbabde
parent 6281ff11817cb52d5f9de43c5231c97da6b4c572
Author: Frederic Cambus <fred@statdns.com>
Date:   Fri,  5 Oct 2018 14:23:25 +0200

Free JSON object once we are done serializing the output

Diffstat:
Msrc/jsonip.c | 1+
Msrc/location.c | 1+
2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/jsonip.c b/src/jsonip.c @@ -47,6 +47,7 @@ jsonip(struct http_request *req) json_object_set_new(output, "ip", json_string(ip)); json = json_dumps(output, JSON_INDENT(3)); + free(output); if (http_argument_get_string(req, "callback", &callback)) { asprintf(&answer, "%s(%s);", callback, json); diff --git a/src/location.c b/src/location.c @@ -145,6 +145,7 @@ location(struct http_request *req) } json = json_dumps(output, JSON_INDENT(3)); + free(output); if (http_argument_get_string(req, "callback", &callback)) { asprintf(&answer, "%s(%s);", callback, json);