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 */