mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
Merged revisions 109309 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r109309 | murf | 2008-03-18 00:37:15 -0600 (Tue, 18 Mar 2008) | 17 lines (closes issue #11903) Reported by: atis Many thanks to atis for spotting this problem and reporting it. The fix was to straighten out how items are placed on and removed from the file stack. Regressions as well as the provided test case helped to straighten out all code paths. valgrind was used to make sure all memory allocated was freed. Sorry for not solving this earlier. I got distracted. Added the ntest23 regression test, which is mainly a copy of ntest22, but with a few juicy errors thrown in, to replicate the kind of error that atis spotted. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109357 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -97,7 +97,7 @@ int ast_add_extension2(struct ast_context *con,
|
||||
const char *registrar);
|
||||
void pbx_builtin_setvar(void *chan, void *data);
|
||||
struct ast_context * ast_context_create(void **extcontexts, const char *name, const char *registrar);
|
||||
struct ast_context * ast_context_find_or_create(void **extcontexts, const char *name, const char *registrar);
|
||||
struct ast_context * ast_context_find_or_create(void **extcontexts, void *tab, const char *name, const char *registrar);
|
||||
void ast_context_add_ignorepat2(struct ast_context *con, const char *value, const char *registrar);
|
||||
void ast_context_add_include2(struct ast_context *con, const char *value, const char *registrar);
|
||||
void ast_context_add_switch2(struct ast_context *con, const char *value, const char *data, int eval, const char *registrar);
|
||||
@@ -361,7 +361,7 @@ struct ast_context * ast_context_create(void **extcontexts, const char *name, co
|
||||
return x;
|
||||
}
|
||||
|
||||
struct ast_context * ast_context_find_or_create(void **extcontexts, const char *name, const char *registrar)
|
||||
struct ast_context * ast_context_find_or_create(void **extcontexts, void *tab, const char *name, const char *registrar)
|
||||
{
|
||||
struct ast_context *x = calloc(1, sizeof(*x));
|
||||
if (!x)
|
||||
|
@@ -610,7 +610,7 @@ struct ast_context *ast_context_find_or_create(struct ast_context **extcontexts,
|
||||
{
|
||||
printf("find/Creating context %s, registrar=%s\n", name, registrar);
|
||||
|
||||
return localized_context_create(extcontexts, name, registrar);
|
||||
return localized_context_find_or_create(extcontexts, exttable, name, registrar);
|
||||
}
|
||||
|
||||
void ast_cli_register_multiple(void);
|
||||
@@ -657,7 +657,7 @@ void ast_merge_contexts_and_delete(struct ast_context **extcontexts, struct ast_
|
||||
|
||||
void ast_merge_contexts_and_delete(struct ast_context **extcontexts, struct ast_hashtab *exttable, const char *registrar)
|
||||
{
|
||||
localized_merge_contexts_and_delete(extcontexts, registrar);
|
||||
localized_merge_contexts_and_delete(extcontexts, exttable, registrar);
|
||||
}
|
||||
|
||||
struct ast_exten *pbx_find_extension(struct ast_channel *chan,
|
||||
|
@@ -5520,20 +5520,18 @@ static int ast_findlabel_extension2(struct ast_channel *c, struct ast_context *c
|
||||
return pbx_extension_helper(c, con, NULL, exten, 0, label, callerid, E_FINDLABEL);
|
||||
}
|
||||
|
||||
static struct ast_context *ast_context_find_or_create(struct ast_context **extcontexts, const char *name, const char *registrar)
|
||||
static struct ast_context *ast_context_find_or_create(struct ast_context **extcontexts, void *tab, const char *name, const char *registrar)
|
||||
{
|
||||
return __ast_context_create(extcontexts, name, registrar, 1);
|
||||
}
|
||||
|
||||
struct ast_context *localized_context_create(struct ast_context **extcontexts, const char *name, const char *registrar);
|
||||
|
||||
struct ast_context *localized_context_create(struct ast_context **extcontexts, const char *name, const char *registrar)
|
||||
struct ast_context *localized_context_find_or_create(struct ast_context **extcontexts, void *tab, const char *name, const char *registrar);
|
||||
struct ast_context *localized_context_find_or_create(struct ast_context **extcontexts, void *tab, const char *name, const char *registrar)
|
||||
{
|
||||
return __ast_context_create(extcontexts, name, registrar, 0);
|
||||
return __ast_context_create(extcontexts, name, registrar, 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* chopped this one off at the knees */
|
||||
static int ast_func_read(struct ast_channel *chan, const char *function, char *workspace, size_t len)
|
||||
{
|
||||
@@ -5916,7 +5914,7 @@ static int pbx_load_config(const char *config_file)
|
||||
/* All categories but "general" or "globals" are considered contexts */
|
||||
if (!strcasecmp(cxt, "general") || !strcasecmp(cxt, "globals"))
|
||||
continue;
|
||||
con=ast_context_find_or_create(&local_contexts,cxt, registrar);
|
||||
con=ast_context_find_or_create(&local_contexts,NULL,cxt, registrar);
|
||||
if (con == NULL)
|
||||
continue;
|
||||
|
||||
|
Reference in New Issue
Block a user