mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 11:58:52 +00:00
res_ari: Fix various memory leaks.
This change fixes a few memory leaks that were found based on a mailing list post. 1. Some JSON response messages were never freed. This was caused by the documentation stating that message references were stolen when in reality they were not. The code now follows the documentation and usage has been updated. 2. HTTP response headers were never freed. 3. The variable list for wildcards paths was never freed. (closes issue ASTERISK-23128) Reported by: Kenneth Watson (on list) Review: https://reviewboard.asterisk.org/r/3119/ ........ Merged revisions 405325 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405326 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -35,7 +35,7 @@ void ast_ari_playbacks_get(struct ast_variable *headers,
|
||||
struct ast_ari_response *response)
|
||||
{
|
||||
RAII_VAR(struct stasis_app_playback *, playback, NULL, ao2_cleanup);
|
||||
RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
|
||||
struct ast_json *json;
|
||||
|
||||
playback = stasis_app_playback_find_by_id(args->playback_id);
|
||||
if (playback == NULL) {
|
||||
@@ -51,7 +51,7 @@ void ast_ari_playbacks_get(struct ast_variable *headers,
|
||||
return;
|
||||
}
|
||||
|
||||
ast_ari_response_ok(response, ast_json_ref(json));
|
||||
ast_ari_response_ok(response, json);
|
||||
}
|
||||
void ast_ari_playbacks_stop(struct ast_variable *headers,
|
||||
struct ast_ari_playbacks_stop_args *args,
|
||||
|
Reference in New Issue
Block a user