diff options
Diffstat (limited to 'res')
-rw-r--r-- | res/res_ari.c | 4 | ||||
-rw-r--r-- | res/stasis_recording/stored.c | 11 |
2 files changed, 12 insertions, 3 deletions
diff --git a/res/res_ari.c b/res/res_ari.c index 5475efce9..f4eca2e43 100644 --- a/res/res_ari.c +++ b/res/res_ari.c @@ -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 = {}; diff --git a/res/stasis_recording/stored.c b/res/stasis_recording/stored.c index f7ecaa179..255976d28 100644 --- a/res/stasis_recording/stored.c +++ b/res/stasis_recording/stored.c @@ -78,7 +78,7 @@ static int split_path(const char *path, char **dir, char **file) { RAII_VAR(char *, relative_dir, NULL, ast_free); RAII_VAR(char *, absolute_dir, NULL, ast_free); - RAII_VAR(char *, real_dir, NULL, free); + RAII_VAR(char *, real_dir, NULL, ast_std_free); char *last_slash; const char *file_portion; @@ -108,7 +108,16 @@ static int split_path(const char *path, char **dir, char **file) return -1; } +#if defined(__AST_DEBUG_MALLOC) *dir = ast_strdup(real_dir); /* Dupe so we can ast_free() */ +#else + /* + * ast_std_free() and ast_free() are the same thing at this time + * so we don't need to dupe. + */ + *dir = real_dir; + real_dir = NULL; +#endif /* defined(__AST_DEBUG_MALLOC) */ *file = ast_strdup(file_portion); return 0; } |