[asterisk-commits] mjordan: trunk r388008 - /trunk/apps/app_directory.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed May 8 13:36:23 CDT 2013
Author: mjordan
Date: Wed May 8 13:36:21 2013
New Revision: 388008
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=388008
Log:
Don't perform a realtime lookup with a NULL keyword
Previously, a call to ast_load_realtime_multientry could get away with
passing a NULL parameter to the function, even though it really isn't
supposed to do that. After the change over to using ast_variable instead
of variadic arguments, the realtime engine gets unhappy if you do this.
This was always an unintended function call in app_directory anyway - now,
we just don't call into the realtime function calls if we don't have anything
to query on.
Modified:
trunk/apps/app_directory.c
Modified: trunk/apps/app_directory.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_directory.c?view=diff&rev=388008&r1=388007&r2=388008
==============================================================================
--- trunk/apps/app_directory.c (original)
+++ trunk/apps/app_directory.c Wed May 8 13:36:21 2013
@@ -440,7 +440,7 @@
static struct ast_config *realtime_directory(char *context)
{
struct ast_config *cfg;
- struct ast_config *rtdata;
+ struct ast_config *rtdata = NULL;
struct ast_category *cat;
struct ast_variable *var;
char *mailbox;
@@ -475,7 +475,7 @@
rtdata = ast_load_realtime_multientry("voicemail", "mailbox LIKE", "%", "context", "default", SENTINEL);
context = "default";
}
- } else {
+ } else if (!ast_strlen_zero(context)) {
rtdata = ast_load_realtime_multientry("voicemail", "mailbox LIKE", "%", "context", context, SENTINEL);
}
More information about the asterisk-commits
mailing list