mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
Fix a couple of memory leaks
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2151 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -5499,7 +5499,6 @@ static void prune_users(void)
|
|||||||
if (user->delme) {
|
if (user->delme) {
|
||||||
ast_free_ha(user->ha);
|
ast_free_ha(user->ha);
|
||||||
free_context(user->contexts);
|
free_context(user->contexts);
|
||||||
user=user->next;
|
|
||||||
free(user);
|
free(user);
|
||||||
if (userlast)
|
if (userlast)
|
||||||
userlast->next = usernext;
|
userlast->next = usernext;
|
||||||
|
@@ -238,6 +238,7 @@ static int ind_load_module(void)
|
|||||||
tones = malloc(sizeof(struct tone_zone));
|
tones = malloc(sizeof(struct tone_zone));
|
||||||
if (!tones) {
|
if (!tones) {
|
||||||
ast_log(LOG_WARNING,"Out of memory\n");
|
ast_log(LOG_WARNING,"Out of memory\n");
|
||||||
|
ast_destroy(cfg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
memset(tones,0,sizeof(struct tone_zone));
|
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));
|
tmp = realloc(tones->ringcadance,(tones->nrringcadance+1)*sizeof(int));
|
||||||
if (!tmp) {
|
if (!tmp) {
|
||||||
ast_log(LOG_WARNING, "Out of memory\n");
|
ast_log(LOG_WARNING, "Out of memory\n");
|
||||||
|
ast_destroy(cfg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
tones->ringcadance = tmp;
|
tones->ringcadance = tmp;
|
||||||
@@ -277,6 +279,7 @@ static int ind_load_module(void)
|
|||||||
struct tone_zone* azone = malloc(sizeof(struct tone_zone));
|
struct tone_zone* azone = malloc(sizeof(struct tone_zone));
|
||||||
if (!azone) {
|
if (!azone) {
|
||||||
ast_log(LOG_WARNING,"Out of memory\n");
|
ast_log(LOG_WARNING,"Out of memory\n");
|
||||||
|
ast_destroy(cfg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
memset(azone,0,sizeof(struct tone_zone));
|
memset(azone,0,sizeof(struct tone_zone));
|
||||||
@@ -303,6 +306,7 @@ static int ind_load_module(void)
|
|||||||
ts = malloc(sizeof(struct tone_zone_sound));
|
ts = malloc(sizeof(struct tone_zone_sound));
|
||||||
if (!ts) {
|
if (!ts) {
|
||||||
ast_log(LOG_WARNING, "Out of memory\n");
|
ast_log(LOG_WARNING, "Out of memory\n");
|
||||||
|
ast_destroy(cfg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
ts->next = NULL;
|
ts->next = NULL;
|
||||||
|
Reference in New Issue
Block a user