diff options
author | Mark Spencer <markster@digium.com> | 2004-02-11 00:17:48 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2004-02-11 00:17:48 +0000 |
commit | 7cdb6d36f4c0579306ae3684dc67c06710d4e74d (patch) | |
tree | 9f2e3abe49a10b3d18753b478a69fba545c1e42f | |
parent | 2671e3d9bbef91ad8e8510b155b5e3c5624adae7 (diff) |
Fix a couple of memory leaks
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2151 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rwxr-xr-x | channels/chan_iax2.c | 1 | ||||
-rwxr-xr-x | res/res_indications.c | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index e24f618be..9668c193f 100755 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -5499,7 +5499,6 @@ static void prune_users(void) if (user->delme) { ast_free_ha(user->ha); free_context(user->contexts); - user=user->next; free(user); if (userlast) userlast->next = usernext; 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; |