From 079a64ae8d93cb30adedbd1ebd4a40b36e805a99 Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 2 Sep 2009 10:22:08 +0000 Subject: Make sure we do not strdup(NULL), avoids a crash with non-real streams. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29621 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/realrtsp/real.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'stream/realrtsp/real.c') diff --git a/stream/realrtsp/real.c b/stream/realrtsp/real.c index dd0f5d4461..a5b37f6e34 100644 --- a/stream/realrtsp/real.c +++ b/stream/realrtsp/real.c @@ -441,7 +441,10 @@ rmff_header_t *real_setup_and_get_header(rtsp_t *rtsp_session, uint32_t bandwidt int i; /* get challenge */ - challenge1=strdup(rtsp_search_answers(rtsp_session,"RealChallenge1")); + challenge1=rtsp_search_answers(rtsp_session,"RealChallenge1"); + if (!challenge1) + goto out; + challenge1=strdup(challenge1); #ifdef LOG printf("real: Challenge1: %s\n", challenge1); #endif -- cgit v1.2.3