From: Mark Michelson Date: Tue, 29 Apr 2008 17:31:26 +0000 (+0000) Subject: Fix a crash happening in app_directory. This crash would occur if a users.conf existed. X-Git-Tag: 1.6.2.0-beta1~2359 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1016811538f1a8cb36c6420374d3099a90cb52e2;p=thirdparty%2Fasterisk.git Fix a crash happening in app_directory. This crash would occur if a users.conf existed. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114832 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_directory.c b/apps/app_directory.c index 981e1f1def..2be28e90d5 100644 --- a/apps/app_directory.c +++ b/apps/app_directory.c @@ -625,7 +625,6 @@ static int search_directory(const char *context, struct ast_config *vmcfg, struc AST_LIST_INSERT_TAIL(alist, item, entry); } - if (ucfg) { for (cat = ast_category_browse(ucfg, NULL); cat ; cat = ast_category_browse(ucfg, cat)) { const char *pos; @@ -641,10 +640,10 @@ static int search_directory(const char *context, struct ast_config *vmcfg, struc res = 0; if (ast_test_flag(&flags, OPT_LISTBYLASTNAME)) { - res = check_match(&item, pos, v->name, ext, 0 /* use_first_name */); + res = check_match(&item, pos, cat, ext, 0 /* use_first_name */); } if (!res && ast_test_flag(&flags, OPT_LISTBYFIRSTNAME)) { - res = check_match(&item, pos, v->name, ext, 1 /* use_first_name */); + res = check_match(&item, pos, cat, ext, 1 /* use_first_name */); } if (!res) @@ -655,7 +654,6 @@ static int search_directory(const char *context, struct ast_config *vmcfg, struc AST_LIST_INSERT_TAIL(alist, item, entry); } } - return 0; }