mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
MALLOC_DEBUG: Fix some misuses of free() when MALLOC_DEBUG is enabled.
* There were several places in ARI where an external library was mallocing memory that must always be released with free(). When MALLOC_DEBUG is enabled, free() is redirected to the MALLOC_DEBUG version. Since the external library call still uses the normal malloc(), MALLOC_DEBUG complains that the freed memory block is not registered and will not free it. These cases must use ast_std_free(). * Changed calls to asprintf() and vasprintf() to the equivalent ast_asprintf() and ast_vasprintf() versions respectively. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400270 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -554,8 +554,8 @@ void ast_ari_get_docs(const char *uri, struct ast_variable *headers,
|
||||
struct ast_ari_response *response)
|
||||
{
|
||||
RAII_VAR(struct ast_str *, absolute_path_builder, NULL, ast_free);
|
||||
RAII_VAR(char *, absolute_api_dirname, NULL, free);
|
||||
RAII_VAR(char *, absolute_filename, NULL, free);
|
||||
RAII_VAR(char *, absolute_api_dirname, NULL, ast_std_free);
|
||||
RAII_VAR(char *, absolute_filename, NULL, ast_std_free);
|
||||
struct ast_json *obj = NULL;
|
||||
struct ast_variable *host = NULL;
|
||||
struct ast_json_error error = {};
|
||||
|
Reference in New Issue
Block a user