summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/json.c4
-rw-r--r--main/stasis_cache.c4
-rw-r--r--main/utils.c13
3 files changed, 11 insertions, 10 deletions
diff --git a/main/json.c b/main/json.c
index 5e50c424a..e3ef3d001 100644
--- a/main/json.c
+++ b/main/json.c
@@ -340,10 +340,10 @@ struct ast_json *ast_json_vstringf(const char *format, va_list args)
json_t *ret = NULL;
if (format) {
- int err = vasprintf(&str, format, args);
+ int err = ast_vasprintf(&str, format, args);
if (err > 0) {
ret = json_string(str);
- free(str);
+ ast_free(str);
}
}
return (struct ast_json *)ret;
diff --git a/main/stasis_cache.c b/main/stasis_cache.c
index 279210d5b..86d4f4d21 100644
--- a/main/stasis_cache.c
+++ b/main/stasis_cache.c
@@ -448,10 +448,10 @@ struct stasis_caching_topic *stasis_caching_topic_create(struct stasis_topic *or
{
RAII_VAR(struct stasis_caching_topic *, caching_topic, NULL, ao2_cleanup);
struct stasis_subscription *sub;
- RAII_VAR(char *, new_name, NULL, free);
+ RAII_VAR(char *, new_name, NULL, ast_free);
int ret;
- ret = asprintf(&new_name, "%s-cached", stasis_topic_name(original_topic));
+ ret = ast_asprintf(&new_name, "%s-cached", stasis_topic_name(original_topic));
if (ret < 0) {
return NULL;
}
diff --git a/main/utils.c b/main/utils.c
index e2c5e2c3f..6eebff71a 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -656,9 +656,10 @@ static void lock_info_destroy(void *data)
}
pthread_mutex_destroy(&lock_info->lock);
- if (lock_info->thread_name)
- free((void *) lock_info->thread_name);
- free(lock_info);
+ if (lock_info->thread_name) {
+ ast_free((void *) lock_info->thread_name);
+ }
+ ast_free(lock_info);
}
/*!
@@ -2184,7 +2185,7 @@ int ast_mkdir(const char *path, int mode)
static int safe_mkdir(const char *base_path, char *path, int mode)
{
- RAII_VAR(char *, absolute_path, NULL, free);
+ RAII_VAR(char *, absolute_path, NULL, ast_std_free);
absolute_path = realpath(path, NULL);
@@ -2206,7 +2207,7 @@ static int safe_mkdir(const char *base_path, char *path, int mode)
int res;
while (path_term) {
- RAII_VAR(char *, absolute_subpath, NULL, free);
+ RAII_VAR(char *, absolute_subpath, NULL, ast_std_free);
/* Truncate the path one past the slash */
char c = *(path_term + 1);
@@ -2254,7 +2255,7 @@ static int safe_mkdir(const char *base_path, char *path, int mode)
int ast_safe_mkdir(const char *base_path, const char *path, int mode)
{
- RAII_VAR(char *, absolute_base_path, NULL, free);
+ RAII_VAR(char *, absolute_base_path, NULL, ast_std_free);
RAII_VAR(char *, p, NULL, ast_free);
if (base_path == NULL || path == NULL) {