diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-02-11 00:17:48 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-02-11 00:17:48 +0000 |
commit | 4ab36f26ab0a683cfb903721bcfe1981e8ec3a75 (patch) | |
tree | 9f2e3abe49a10b3d18753b478a69fba545c1e42f /res/res_indications.c | |
parent | 54cc2eeabf0999f337198f5df53c97d296177182 (diff) |
Fix a couple of memory leaks
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2151 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_indications.c')
-rwxr-xr-x | res/res_indications.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/res/res_indications.c b/res/res_indications.c index 0983efbca..78eb2a33d 100755 --- a/res/res_indications.c +++ b/res/res_indications.c @@ -238,6 +238,7 @@ static int ind_load_module(void) tones = malloc(sizeof(struct tone_zone)); if (!tones) { ast_log(LOG_WARNING,"Out of memory\n"); + ast_destroy(cfg); return -1; } memset(tones,0,sizeof(struct tone_zone)); @@ -261,6 +262,7 @@ static int ind_load_module(void) tmp = realloc(tones->ringcadance,(tones->nrringcadance+1)*sizeof(int)); if (!tmp) { ast_log(LOG_WARNING, "Out of memory\n"); + ast_destroy(cfg); return -1; } tones->ringcadance = tmp; @@ -277,6 +279,7 @@ static int ind_load_module(void) struct tone_zone* azone = malloc(sizeof(struct tone_zone)); if (!azone) { ast_log(LOG_WARNING,"Out of memory\n"); + ast_destroy(cfg); return -1; } memset(azone,0,sizeof(struct tone_zone)); @@ -303,6 +306,7 @@ static int ind_load_module(void) ts = malloc(sizeof(struct tone_zone_sound)); if (!ts) { ast_log(LOG_WARNING, "Out of memory\n"); + ast_destroy(cfg); return -1; } ts->next = NULL; |