From 2ebcc4ae6bef0e3cd0ec9e9a80145b9a8513de73 Mon Sep 17 00:00:00 2001 From: Jan-Piet Mens Date: Fri, 24 May 2024 21:45:40 +0200 Subject: [PATCH] free no-longer needed json data addresses https://github.com/owntracks/recorder/issues/464 --- http.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/http.c b/http.c index e18721c..f2ffef9 100644 --- a/http.c +++ b/http.c @@ -1053,9 +1053,12 @@ static int view(struct mg_connection *conn, const char *viewname) if ((geoline = geo_linestring(locarray)) != NULL) { json_delete(obj); + json_delete(locarray); return (json_response(conn, geoline)); } + json_delete(locarray); + /* Return empty object */ return (json_response(conn, obj)); @@ -1101,6 +1104,7 @@ static int view(struct mg_connection *conn, const char *viewname) json_append_member(obj, "data", locarray); json_delete(view); + json_delete(locarray); return (json_response(conn, obj)); /* NOTREACHED */