diff options
author | Matthew Jordan <mjordan@digium.com> | 2013-05-08 18:36:21 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2013-05-08 18:36:21 +0000 |
commit | 671f900225f89794db9b6404108fe648a017f43a (patch) | |
tree | 5c74c01987ce2a102ee77ae677a8c1ea3500e78d | |
parent | 0eb4cf8c194d05214677459feb389f63f60c68af (diff) |
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.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388008 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | apps/app_directory.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/app_directory.c b/apps/app_directory.c index b26a09cd9..edfc349ea 100644 --- a/apps/app_directory.c +++ b/apps/app_directory.c @@ -440,7 +440,7 @@ AST_THREADSTORAGE(commonbuf); 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 @@ static struct ast_config *realtime_directory(char *context) 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); } |