summaryrefslogtreecommitdiff
path: root/funcs/func_config.c
diff options
context:
space:
mode:
Diffstat (limited to 'funcs/func_config.c')
-rw-r--r--funcs/func_config.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/funcs/func_config.c b/funcs/func_config.c
index cbc51aaae..d45ad2c82 100644
--- a/funcs/func_config.c
+++ b/funcs/func_config.c
@@ -120,7 +120,7 @@ static int config_function_read(struct ast_channel *chan, const char *cmd, char
/* At worst, we might leak an entry while upgrading locks */
AST_RWLIST_UNLOCK(&configs);
AST_RWLIST_WRLOCK(&configs);
- if (!(cur = ast_malloc(sizeof(*cur) + strlen(args.filename) + 1))) {
+ if (!(cur = ast_calloc(1, sizeof(*cur) + strlen(args.filename) + 1))) {
AST_RWLIST_UNLOCK(&configs);
return -1;
}
@@ -149,7 +149,7 @@ static int config_function_read(struct ast_channel *chan, const char *cmd, char
}
if (!cur) {
- if (!(cur = ast_malloc(sizeof(*cur) + strlen(args.filename) + 1))) {
+ if (!(cur = ast_calloc(1, sizeof(*cur) + strlen(args.filename) + 1))) {
AST_RWLIST_UNLOCK(&configs);
return -1;
}