[Asterisk-cvs] asterisk/res res_indications.c,1.4,1.5

markster at lists.digium.com markster at lists.digium.com
Tue Feb 10 18:09:02 CST 2004


Update of /usr/cvsroot/asterisk/res
In directory mongoose.digium.com:/tmp/cvs-serv17068/res

Modified Files:
	res_indications.c 
Log Message:
Fix a couple of memory leaks


Index: res_indications.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_indications.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- res_indications.c	13 Aug 2003 15:25:16 -0000	1.4
+++ res_indications.c	11 Feb 2004 00:17:48 -0000	1.5
@@ -238,6 +238,7 @@
 		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 @@
 					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 @@
 					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 @@
 				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;




More information about the svn-commits mailing list