[asterisk-commits] tilghman: trunk r50784 - /trunk/main/config.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Jan 13 22:34:33 MST 2007


Author: tilghman
Date: Sat Jan 13 23:34:32 2007
New Revision: 50784

URL: http://svn.digium.com/view/asterisk?view=rev&rev=50784
Log:
Bug 8803 - Fix crash in API

Modified:
    trunk/main/config.c

Modified: trunk/main/config.c
URL: http://svn.digium.com/view/asterisk/trunk/main/config.c?view=diff&rev=50784&r1=50783&r2=50784
==============================================================================
--- trunk/main/config.c (original)
+++ trunk/main/config.c Sat Jan 13 23:34:32 2007
@@ -1317,18 +1317,27 @@
 	return result;
 }
 
-struct ast_variable *ast_load_realtime_all(const char *family, ...)
+static struct ast_variable *ast_load_realtime_helper(const char *family, va_list ap)
 {
 	struct ast_config_engine *eng;
 	char db[256]="";
 	char table[256]="";
 	struct ast_variable *res=NULL;
-	va_list ap;
-
-	va_start(ap, family);
+
 	eng = find_engine(family, db, sizeof(db), table, sizeof(table));
 	if (eng && eng->realtime_func) 
 		res = eng->realtime_func(db, table, ap);
+
+	return res;
+}
+
+struct ast_variable *ast_load_realtime_all(const char *family, ...)
+{
+	struct ast_variable *res;
+	va_list ap;
+
+	va_start(ap, family);
+	res = ast_load_realtime_helper(family, ap);
 	va_end(ap);
 
 	return res;
@@ -1340,7 +1349,7 @@
 	va_list ap;
 
 	va_start(ap, family);
-	res = ast_load_realtime_all(family, ap);
+	res = ast_load_realtime_helper(family, ap);
 	va_end(ap);
 
 	/* Eliminate blank entries */



More information about the asterisk-commits mailing list