-fix memory leak
This commit is contained in:
parent
6761e2a997
commit
5017dacbda
@ -124,6 +124,21 @@ TALER_MHD_reply_json (struct MHD_Connection *connection,
|
|||||||
unsigned int response_code);
|
unsigned int response_code);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send JSON object as response, and free the @a json
|
||||||
|
* object.
|
||||||
|
*
|
||||||
|
* @param connection the MHD connection
|
||||||
|
* @param json the json object (freed!)
|
||||||
|
* @param response_code the http response code
|
||||||
|
* @return MHD result code
|
||||||
|
*/
|
||||||
|
MHD_RESULT
|
||||||
|
TALER_MHD_reply_json_steal (struct MHD_Connection *connection,
|
||||||
|
json_t *json,
|
||||||
|
unsigned int response_code);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to call to handle the request by building a JSON
|
* Function to call to handle the request by building a JSON
|
||||||
* reply from a format string and varargs.
|
* reply from a format string and varargs.
|
||||||
@ -151,7 +166,7 @@ TALER_MHD_reply_json_pack (struct MHD_Connection *connection,
|
|||||||
* @return MHD result code
|
* @return MHD result code
|
||||||
*/
|
*/
|
||||||
#define TALER_MHD_REPLY_JSON_PACK(connection,response_code,...) \
|
#define TALER_MHD_REPLY_JSON_PACK(connection,response_code,...) \
|
||||||
TALER_MHD_reply_json (connection, GNUNET_JSON_PACK (__VA_ARGS__), \
|
TALER_MHD_reply_json_steal (connection, GNUNET_JSON_PACK (__VA_ARGS__), \
|
||||||
response_code)
|
response_code)
|
||||||
|
|
||||||
|
|
||||||
|
@ -219,6 +219,21 @@ TALER_MHD_reply_json (struct MHD_Connection *connection,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
MHD_RESULT
|
||||||
|
TALER_MHD_reply_json_steal (struct MHD_Connection *connection,
|
||||||
|
json_t *json,
|
||||||
|
unsigned int response_code)
|
||||||
|
{
|
||||||
|
MHD_RESULT ret;
|
||||||
|
|
||||||
|
ret = TALER_MHD_reply_json (connection,
|
||||||
|
json,
|
||||||
|
response_code);
|
||||||
|
json_decref (json);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
MHD_RESULT
|
MHD_RESULT
|
||||||
TALER_MHD_reply_cors_preflight (struct MHD_Connection *connection)
|
TALER_MHD_reply_cors_preflight (struct MHD_Connection *connection)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user