From b8d39db94dc8dc21e24d77fb317129b442203afa Mon Sep 17 00:00:00 2001
From: Mark Michelson <mmichelson@digium.com>
Date: Wed, 2 Jun 2010 18:13:18 +0000
Subject: [PATCH] Prevent use of uninitialized values.

Two struct sockaddr_ins are created when applying directmedia
host access rules. The addresses of these are passed to the RTP
engine to be filled in. However, the RTP engine inspects the fields
of the structs before actually taking action. This inspection caused
valgrind to be a bit unhappy.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@267097 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 channels/chan_sip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 6c4cba72ae..8fb16b4062 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -26537,7 +26537,7 @@ static int reload_config(enum channelreloadreason reason)
 
 static int apply_directmedia_ha(struct sip_pvt *p, const char *op)
 {
-	struct sockaddr_in us, them;
+	struct sockaddr_in us = {0,}, them = {0,};
 	int res;
 
 	ast_rtp_instance_get_remote_address(p->rtp, &them);
-- 
GitLab