aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_directory.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/app_directory.c')
-rw-r--r--apps/app_directory.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/app_directory.c b/apps/app_directory.c
index ea370d7db..a5fb06e88 100644
--- a/apps/app_directory.c
+++ b/apps/app_directory.c
@@ -404,6 +404,7 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, struct
int lastuserchoice = 0;
char *start, *conv, *stringp = NULL;
const char *pos;
+ int breakout = 0;
if (ast_strlen_zero(context)) {
ast_log(LOG_WARNING,
@@ -527,6 +528,7 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, struct
* user hungup
*/
lastuserchoice = 0;
+ breakout = 1;
break;
case '1':
/* user pressed '1' and extensions exists;
@@ -534,19 +536,24 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, struct
a goto() on the channel
*/
lastuserchoice = res;
+ breakout = 1;
break;
case '*':
/* user pressed '*' to skip something found */
lastuserchoice = res;
+ breakout = 0;
res = 0;
break;
default:
+ breakout = 1;
break;
}
free(conv);
- break;
+ if (breakout)
+ break;
}
- free(conv);
+ else
+ free(conv);
}
}
}