-fix another leak
This commit is contained in:
parent
5017dacbda
commit
5026518bb5
@ -211,6 +211,16 @@ struct MHD_Response *
|
|||||||
TALER_MHD_make_json (const json_t *json);
|
TALER_MHD_make_json (const json_t *json);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make JSON response object and free @a json.
|
||||||
|
*
|
||||||
|
* @param json the json object, freed.
|
||||||
|
* @return MHD response object
|
||||||
|
*/
|
||||||
|
struct MHD_Response *
|
||||||
|
TALER_MHD_make_json_steal (json_t *json);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make JSON response object.
|
* Make JSON response object.
|
||||||
*
|
*
|
||||||
@ -230,7 +240,7 @@ TALER_MHD_make_json_pack (const char *fmt,
|
|||||||
* @return MHD response object
|
* @return MHD response object
|
||||||
*/
|
*/
|
||||||
#define TALER_MHD_MAKE_JSON_PACK(...) \
|
#define TALER_MHD_MAKE_JSON_PACK(...) \
|
||||||
TALER_MHD_make_json (GNUNET_JSON_PACK (__VA_ARGS__))
|
TALER_MHD_make_json_steal (GNUNET_JSON_PACK (__VA_ARGS__))
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -148,6 +148,17 @@ TALER_MHD_make_json (const json_t *json)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
struct MHD_Response *
|
||||||
|
TALER_MHD_make_json_steal (json_t *json)
|
||||||
|
{
|
||||||
|
struct MHD_Response *res;
|
||||||
|
|
||||||
|
res = TALER_MHD_make_json (json);
|
||||||
|
json_decref (json);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
MHD_RESULT
|
MHD_RESULT
|
||||||
TALER_MHD_reply_json (struct MHD_Connection *connection,
|
TALER_MHD_reply_json (struct MHD_Connection *connection,
|
||||||
const json_t *json,
|
const json_t *json,
|
||||||
|
Loading…
Reference in New Issue
Block a user