aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_dial.c
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-21 11:53:06 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-21 11:53:06 +0000
commitff1233d501b60a2637911d777a1757cebf8dee36 (patch)
tree89f1e4cd6cff35603c18d029275a111576e32087 /apps/app_dial.c
parenteb492ff8127c1c4480e73fb841023d35bc87c34c (diff)
better fix for the previous bug.
In general this code needs a deep revision, because the body of do_forward() deletes/overwrites the output channel without freeing the resouce in some cases, and without notifying the caller. Also, on FreeBSD with MALLOC_OPTIONS set i am seeing various panics (duplicate freee etc.) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47881 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r--apps/app_dial.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 6c1501b63..2d15fbefc 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -419,7 +419,12 @@ static void senddialendevent(const struct ast_channel *src, const char *dialstat
src->name, dialstatus);
}
-/* helper function for wait_for_answer() */
+/*!
+ * helper function for wait_for_answer()
+ *
+ * XXX this code is highly suspicious, as it essentially overwrites
+ * the outgoing channel without properly deleting it.
+ */
static void do_forward(struct dial_localuser *o,
struct cause_args *num, struct ast_flags *peerflags, int single)
{
@@ -504,9 +509,9 @@ static void do_forward(struct dial_localuser *o,
char cidname[AST_MAX_EXTENSION];
ast_set_callerid(c, S_OR(in->macroexten, in->exten), get_cid_name(cidname, sizeof(cidname), in), NULL);
}
+ /* Hangup the original channel now, in case we needed it */
+ ast_hangup(c);
}
- /* Hangup the original channel now, in case we needed it */
- ast_hangup(c);
}
}