[svn-commits] file: trunk r48967 - in /trunk: ./ apps/app_meetme.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Mon Dec 25 22:23:25 MST 2006


Author: file
Date: Mon Dec 25 23:23:25 2006
New Revision: 48967

URL: http://svn.digium.com/view/asterisk?view=rev&rev=48967
Log:
Merged revisions 48966 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r48966 | file | 2006-12-26 00:20:08 -0500 (Tue, 26 Dec 2006) | 2 lines

Get rid of a needless memory allocation and only create a conference structure in find_conf_realtime if data was read from realtime. (issue #8669 reported by robl)

........

Modified:
    trunk/   (props changed)
    trunk/apps/app_meetme.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_meetme.c?view=diff&rev=48967&r1=48966&r2=48967
==============================================================================
--- trunk/apps/app_meetme.c (original)
+++ trunk/apps/app_meetme.c Mon Dec 25 23:23:25 2006
@@ -1979,25 +1979,21 @@
 		if (!strcmp(confno, cnf->confno)) 
 			break;
 	}
-	if (cnf){
+	if (cnf) {
 		cnf->refcount += refcount;
 	}
 	AST_LIST_UNLOCK(&confs);
 
 	if (!cnf) {
 		char *pin = NULL, *pinadmin = NULL; /* For temp use */
-
-		cnf = ast_calloc(1, sizeof(struct ast_conference));
-		if (!cnf) {
-			ast_log(LOG_ERROR, "Out of memory\n");
+		
+		var = ast_load_realtime("meetme", "confno", confno, NULL);
+
+		if (!var)
 			return NULL;
-		}
-
-		var = ast_load_realtime("meetme", "confno", confno, NULL);
+
 		while (var) {
-			if (!strcasecmp(var->name, "confno")) {
-				ast_copy_string(cnf->confno, var->value, sizeof(cnf->confno));
-			} else if (!strcasecmp(var->name, "pin")) {
+			if (!strcasecmp(var->name, "pin")) {
 				pin = ast_strdupa(var->value);
 			} else if (!strcasecmp(var->name, "adminpin")) {
 				pinadmin = ast_strdupa(var->value);
@@ -2005,7 +2001,7 @@
 			var = var->next;
 		}
 		ast_variables_destroy(var);
-
+		
 		cnf = build_conf(confno, pin ? pin : "", pinadmin ? pinadmin : "", make, dynamic, refcount);
 	}
 



More information about the svn-commits mailing list