aboutsummaryrefslogtreecommitdiffstats
path: root/config.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2002-04-22 15:14:18 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2002-04-22 15:14:18 +0000
commit78cb84239fd1d60ee04830398e99494b3106089e (patch)
tree00463dd6980b2d39ced9e4593aca0a4b9bd87c02 /config.c
parent971e0705c2a98a4c4accdb1cd9ec58d89f16027d (diff)
Version 0.1.12 from FTP
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@434 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'config.c')
-rwxr-xr-xconfig.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/config.c b/config.c
index 42e2f6a53..d758d7fac 100755
--- a/config.c
+++ b/config.c
@@ -177,6 +177,7 @@ static int cfg_process(struct ast_config *tmp, struct ast_category **_tmpc, stru
"Out of memory, line %d\n", lineno);
return -1;
}
+ memset(*_tmpc, 0, sizeof(struct ast_category));
strncpy((*_tmpc)->name, cur+1, sizeof((*_tmpc)->name) - 1);
(*_tmpc)->root = NULL;
(*_tmpc)->next = tmp->root;
@@ -237,6 +238,7 @@ static int cfg_process(struct ast_config *tmp, struct ast_category **_tmpc, stru
c++;
v = malloc(sizeof(struct ast_variable));
if (v) {
+ memset(v, 0, sizeof(struct ast_variable));
v->next = NULL;
v->name = strdup(strip(cur));
v->value = strdup(strip(c));
@@ -283,7 +285,8 @@ static struct ast_config *__ast_load(char *configfile, struct ast_config *tmp, s
ast_verbose( "Found\n");
if (!tmp) {
tmp = malloc(sizeof(struct ast_config));
- tmp->root = NULL;
+ if (tmp)
+ memset(tmp, 0, sizeof(struct ast_config));
}
if (!tmp) {
ast_log(LOG_WARNING, "Out of memory\n");