summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/logger.c3
-rw-r--r--main/pbx.c8
2 files changed, 6 insertions, 5 deletions
diff --git a/main/logger.c b/main/logger.c
index bceaf092f..91ae572f9 100644
--- a/main/logger.c
+++ b/main/logger.c
@@ -1159,6 +1159,9 @@ void ast_backtrace(void)
for (i = 0; i < bt->num_frames; i++) {
ast_log(LOG_DEBUG, "#%d: [%p] %s\n", i, bt->addresses[i], strings[i]);
}
+
+ /* MALLOC_DEBUG will erroneously report an error here, unless we undef the macro. */
+#undef free
free(strings);
} else {
ast_debug(1, "Could not allocate memory for backtrace\n");
diff --git a/main/pbx.c b/main/pbx.c
index d5f4ead90..dbde400b9 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -7908,12 +7908,10 @@ static int ast_add_extension2_lockopt(struct ast_context *con,
/* If we are adding a hint evalulate in variables and global variables */
if (priority == PRIORITY_HINT && strstr(application, "${") && !strstr(extension, "_")) {
- struct ast_channel c = {0, };
-
- ast_copy_string(c.exten, extension, sizeof(c.exten));
- ast_copy_string(c.context, con->name, sizeof(c.context));
- pbx_substitute_variables_helper(&c, application, expand_buf, sizeof(expand_buf));
+ struct ast_channel *c = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "", extension, con->name, 0, "Bogus/%s", __PRETTY_FUNCTION__);
+ pbx_substitute_variables_helper(c, application, expand_buf, sizeof(expand_buf));
application = expand_buf;
+ ast_channel_release(c);
}
length = sizeof(struct ast_exten);