From 792beb468626815d56bb8e016022738766443ad7 Mon Sep 17 00:00:00 2001
From: Jason Parker <jparker@digium.com>
Date: Tue, 26 Jun 2007 20:36:50 +0000
Subject: [PATCH] Merged revisions 71915 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r71915 | qwell | 2007-06-26 15:36:09 -0500 (Tue, 26 Jun 2007) | 4 lines

Don't dereference a pointer that may be NULL here.

Issue 10017.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@71916 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 main/rtp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/main/rtp.c b/main/rtp.c
index 691d39160e..ca2b01c9bf 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -2709,6 +2709,9 @@ static int ast_rtcp_write(void *data)
 	struct ast_rtp *rtp = data;
 	int res;
 	
+	if (!rtp || !rtp->rtcp)
+		return 0;
+
 	if (rtp->txcount > rtp->rtcp->lastsrtxcount)
 		res = ast_rtcp_write_sr(data);
 	else
-- 
GitLab