commit 2407145b0e0e676ffda3c415448666deae5ae8a3
parent 4241d0d9a0911139c635f2ae2d5143d6bad281c2
Author: Christian Grothoff <christian@grothoff.org>
Date: Sat, 13 Feb 2021 19:21:11 +0100
fix memory leak
Diffstat:
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git 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;
}
}