diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/pbx.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/main/pbx.c b/main/pbx.c index 67d4ac71a..c232b9bb2 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -2017,14 +2017,19 @@ void ast_hint_state_changed(const char *device) AST_LIST_TRAVERSE(&hints, hint, list) { struct ast_state_cb *cblist; - char *parse = ast_strdupa(ast_get_extension_app(hint->exten)); - char *cur; + /* can't use ast_strdupa() here because we may run out of stack + * space while looping over a large number of large strings */ + char *dup = ast_strdup(ast_get_extension_app(hint->exten)); + char *cur, *parse = dup; int state; while ( (cur = strsep(&parse, "&")) ) { if (!strcasecmp(cur, device)) break; } + + ast_free(dup); + if (!cur) continue; |