From 2407145b0e0e676ffda3c415448666deae5ae8a3 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 13 Feb 2021 19:21:11 +0100 Subject: fix memory leak --- src/backend/taler-merchant-httpd_private-get-products-ID.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/backend/taler-merchant-httpd_private-get-products-ID.c b/src/backend/taler-merchant-httpd_private-get-products-ID.c index 915b016c..0fc666eb 100644 --- a/src/backend/taler-merchant-httpd_private-get-products-ID.c +++ b/src/backend/taler-merchant-httpd_private-get-products-ID.c @@ -62,6 +62,7 @@ TMH_private_get_products_ID (const struct TMH_RequestHandler *rh, } { json_t *reply; + MHD_RESULT ret; reply = json_pack ( "{s:s, s:s, s:o, s:o, s:I," @@ -95,9 +96,11 @@ TMH_private_get_products_ID (const struct TMH_RequestHandler *rh, json_object_set_new (reply, "next_restock", GNUNET_JSON_from_time_abs (pd.next_restock)); - return TALER_MHD_reply_json (connection, - reply, - MHD_HTTP_OK); + ret = TALER_MHD_reply_json (connection, + reply, + MHD_HTTP_OK); + json_decref (reply); + return ret; } } -- cgit v1.2.3