[asterisk-commits] murf: branch 1.4 r89088 - in /branches/1.4: cdr/ pbx/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Nov 7 15:40:28 CST 2007


Author: murf
Date: Wed Nov  7 15:40:28 2007
New Revision: 89088

URL: http://svn.digium.com/view/asterisk?view=rev&rev=89088
Log:
In response to 10578, I just ran 1.4 thru valgrind; some of the config leakage I've already fixed, but it doesn't hurt to double check. I found and fixed leaks in res_jabber, cdr_tds, pbx_ael. Nothing major, tho.

Modified:
    branches/1.4/cdr/cdr_tds.c
    branches/1.4/pbx/pbx_ael.c
    branches/1.4/res/res_jabber.c

Modified: branches/1.4/cdr/cdr_tds.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/cdr/cdr_tds.c?view=diff&rev=89088&r1=89087&r2=89088
==============================================================================
--- branches/1.4/cdr/cdr_tds.c (original)
+++ branches/1.4/cdr/cdr_tds.c Wed Nov  7 15:40:28 2007
@@ -441,9 +441,11 @@
 	}
 
 	var = ast_variable_browse(cfg, "global");
-	if (!var) /* nothing configured */
+	if (!var) /* nothing configured */ {
+		ast_config_destroy(cfg);
 		return 0;
-
+	}
+	
 	ptr = ast_variable_retrieve(cfg, "global", "hostname");
 	if (ptr)
 		hostname = strdup(ptr);

Modified: branches/1.4/pbx/pbx_ael.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/pbx/pbx_ael.c?view=diff&rev=89088&r1=89087&r2=89088
==============================================================================
--- branches/1.4/pbx/pbx_ael.c (original)
+++ branches/1.4/pbx/pbx_ael.c Wed Nov  7 15:40:28 2007
@@ -2993,7 +2993,7 @@
 				strncat(buf2,strp2+1, sizeof(buf2)-strlen(strp2+1)-2);
 				strcat(buf2,"]");
 				for_init->appargs = strdup(buf2);
-				for_init->app = strdup("Set");
+				/* for_init->app = strdup("Set"); just set! */
 			} else {
 				strp2 = p->u1.for_init;
 				while (*strp2 && isspace(*strp2))
@@ -3015,7 +3015,8 @@
 						*strp3 = 0; /* remove the closing paren */
 
 					for_init->appargs = strdup(buf2);
-
+					if (for_init->app)
+						free(for_init->app);
 					for_init->app = strdup("Macro");
 				} else {  /* must be a regular app call */
 					char *strp3;
@@ -3023,6 +3024,8 @@
 					strp3 = strchr(buf2,'(');
 					if (strp3) {
 						*strp3 = 0;
+						if (for_init->app)
+							free(for_init->app);
 						for_init->app = strdup(buf2);
 						for_init->appargs = strdup(strp3+1);
 						strp3 = strrchr(for_init->appargs, ')');

Modified: branches/1.4/res/res_jabber.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/res/res_jabber.c?view=diff&rev=89088&r1=89087&r2=89088
==============================================================================
--- branches/1.4/res/res_jabber.c (original)
+++ branches/1.4/res/res_jabber.c Wed Nov  7 15:40:28 2007
@@ -2354,6 +2354,7 @@
 		}
 		cat = ast_category_browse(cfg, cat);
 	}
+	ast_config_destroy(cfg); /* or leak memory */
 	return 1;
 }
 




More information about the asterisk-commits mailing list