[asterisk-commits] russell: branch 1.2 r75107 - /branches/1.2/res/res_musiconhold.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jul 13 15:35:23 CDT 2007


Author: russell
Date: Fri Jul 13 15:35:22 2007
New Revision: 75107

URL: http://svn.digium.com/view/asterisk?view=rev&rev=75107
Log:
Fix a couple potential minor memory leaks.  load_moh_classes() could return
without destroying the loaded configuration.

Modified:
    branches/1.2/res/res_musiconhold.c

Modified: branches/1.2/res/res_musiconhold.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/res/res_musiconhold.c?view=diff&rev=75107&r1=75106&r2=75107
==============================================================================
--- branches/1.2/res/res_musiconhold.c (original)
+++ branches/1.2/res/res_musiconhold.c Fri Jul 13 15:35:22 2007
@@ -1052,7 +1052,7 @@
 				class = moh_class_malloc();
 				if (!class) {
 					ast_log(LOG_WARNING, "Out of memory!\n");
-					return numclasses;
+					break;
 				}
 				
 				ast_copy_string(class->name, var->name, sizeof(class->name));
@@ -1080,7 +1080,7 @@
 			class = moh_class_malloc();
 			if (!class) {
 				ast_log(LOG_WARNING, "Out of memory!\n");
-				return numclasses;
+				break;
 			}
 			
 			ast_copy_string(class->name, var->name, sizeof(class->name));




More information about the asterisk-commits mailing list