diff --git a/funcs/func_config.c b/funcs/func_config.c
index cbc51aaae6ecc0e70e34c777ab849e45f3b49521..d45ad2c820ca695c0bcef1426a2f5e15ba711ba3 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;
 			}