changeset 29579:26e0c6a16e57

Make sure we do not strdup(NULL), avoids a crash with non-real streams.
author reimar
date Wed, 02 Sep 2009 10:22:08 +0000
parents b0ee310c2216
children d3df5ca12917
files stream/realrtsp/real.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/stream/realrtsp/real.c	Wed Sep 02 10:20:45 2009 +0000
+++ b/stream/realrtsp/real.c	Wed Sep 02 10:22:08 2009 +0000
@@ -441,7 +441,10 @@
   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