]> git.sesse.net Git - vlc/commitdiff
vod_rtsp: fix segfault if memory allocation fails
authorPierre Ynard <linkfanel@yahoo.fr>
Tue, 30 Jun 2009 15:04:07 +0000 (17:04 +0200)
committerPierre Ynard <linkfanel@yahoo.fr>
Tue, 30 Jun 2009 15:04:07 +0000 (17:04 +0200)
Fix segfault if memory allocation fails

modules/misc/rtsp.c

index bec5db519047075e265cab4304b3a3674c59e09f..80e27a0bbc779c1fbc48b50aab6abddf45dadecb 100644 (file)
@@ -1423,6 +1423,13 @@ static int RtspCallbackES( httpd_callback_sys_t *p_args, httpd_client_t *cl,
                     psz_session = psz_new;
 
                     p_rtsp = RtspClientNew( p_media, psz_new );
+                    if( !p_rtsp )
+                    {
+                        answer->i_status = 454;
+                        answer->i_body = 0;
+                        answer->p_body = NULL;
+                        break;
+                    }
                 }
                 else
                 {