summaryrefslogtreecommitdiff
path: root/main/rtp_engine.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2009-06-02 13:12:59 +0000
committerJoshua Colp <jcolp@digium.com>2009-06-02 13:12:59 +0000
commit4900d37d71ff8171461075f8b16ee486c730f106 (patch)
treeb7689d4a854dc6a5b63941d07b93a66d4990475e /main/rtp_engine.c
parenta13d62aa49750ae95fd9148a2a1640c676618a94 (diff)
Fix a bug where we were passing in address information that should remain unmodified to a function that may modify it.
(closes issue #15243) Reported by: pj git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198762 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/rtp_engine.c')
-rw-r--r--main/rtp_engine.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/rtp_engine.c b/main/rtp_engine.c
index 90c6471f6..85ee9b69f 100644
--- a/main/rtp_engine.c
+++ b/main/rtp_engine.c
@@ -278,6 +278,7 @@ int ast_rtp_instance_destroy(struct ast_rtp_instance *instance)
struct ast_rtp_instance *ast_rtp_instance_new(const char *engine_name, struct sched_context *sched, struct sockaddr_in *sin, void *data)
{
+ struct sockaddr_in address = { 0, };
struct ast_rtp_instance *instance = NULL;
struct ast_rtp_engine *engine = NULL;
@@ -315,11 +316,12 @@ struct ast_rtp_instance *ast_rtp_instance_new(const char *engine_name, struct sc
instance->local_address.sin_family = AF_INET;
instance->local_address.sin_addr = sin->sin_addr;
instance->remote_address.sin_family = AF_INET;
+ address.sin_addr = sin->sin_addr;
ast_debug(1, "Using engine '%s' for RTP instance '%p'\n", engine->name, instance);
/* And pass it off to the engine to setup */
- if (instance->engine->new(instance, sched, sin, data)) {
+ if (instance->engine->new(instance, sched, &address, data)) {
ast_debug(1, "Engine '%s' failed to setup RTP instance '%p'\n", engine->name, instance);
ao2_ref(instance, -1);
return NULL;