summaryrefslogtreecommitdiff
path: root/main/udptl.c
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2008-03-11 11:36:51 +0000
committerKevin P. Fleming <kpfleming@digium.com>2008-03-11 11:36:51 +0000
commit79c3038ee531e5d0678859e1f82416c6a1885055 (patch)
treefb0dd86e39fddade0dcd96af295777d21ce0197b /main/udptl.c
parenta9a3f001e0973861efd0dff2ea04d8eb0404111a (diff)
Merged revisions 107352 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r107352 | kpfleming | 2008-03-11 06:04:29 -0500 (Tue, 11 Mar 2008) | 11 lines fix up various compiler warnings found with gcc-4.3: - the output of flex includes a static function called 'input' that is not used, so for the moment we'll stop having the compiler tell us about unused variables in the flex source files (a better fix would be to improve our flex post-processing to remove the unused function) - main/stdtime/localtime.c makes assumptions about signed integer overflow, and gcc-4.3's improved optimizer tries to take advantage of handling potential overflow conditions at compile time; for now, suppress these optimizations until we can fiure out if the code needs improvement - main/udptl.c has some references to uninitialized variables; in one case there was no bug, but in the other it was certainly possibly for unexpected behavior to occur - main/editline/readline.c had an unused variable ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@107373 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/udptl.c')
-rw-r--r--main/udptl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/main/udptl.c b/main/udptl.c
index 6ce344328..2f0e1fb97 100644
--- a/main/udptl.c
+++ b/main/udptl.c
@@ -860,6 +860,7 @@ void ast_udptl_set_peer(struct ast_udptl *udptl, struct sockaddr_in *them)
void ast_udptl_get_peer(struct ast_udptl *udptl, struct sockaddr_in *them)
{
+ memset(them, 0, sizeof(*them));
them->sin_family = AF_INET;
them->sin_port = udptl->them.sin_port;
them->sin_addr = udptl->them.sin_addr;
@@ -1013,13 +1014,15 @@ int ast_udptl_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags,
}
if (pr0->set_udptl_peer(c0, p1)) {
ast_log(LOG_WARNING, "Channel '%s' failed to talk to '%s'\n", c0->name, c1->name);
+ memset(&ac1, 0, sizeof(ac1));
} else {
/* Store UDPTL peer */
ast_udptl_get_peer(p1, &ac1);
}
- if (pr1->set_udptl_peer(c1, p0))
+ if (pr1->set_udptl_peer(c1, p0)) {
ast_log(LOG_WARNING, "Channel '%s' failed to talk back to '%s'\n", c1->name, c0->name);
- else {
+ memset(&ac0, 0, sizeof(ac0));
+ } else {
/* Store UDPTL peer */
ast_udptl_get_peer(p0, &ac0);
}