changeset 18095:5327871ea0e5

missing free in case sdpplin_parse_stream returns invalid stream.
author reimar
date Fri, 14 Apr 2006 14:10:04 +0000
parents 16f2bcd5d148
children f92a441c0442
files libmpdemux/realrtsp/sdpplin.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/realrtsp/sdpplin.c	Fri Apr 14 13:37:38 2006 +0000
+++ b/libmpdemux/realrtsp/sdpplin.c	Fri Apr 14 14:10:04 2006 +0000
@@ -238,7 +238,6 @@
 sdpplin_t *sdpplin_parse(char *data) {
 
   sdpplin_t        *desc=calloc(1,sizeof(sdpplin_t));
-  sdpplin_stream_t *stream;
   char             *buf=xbuffer_init(32);
   char             *decoded=xbuffer_init(32);
   int              handled;
@@ -249,14 +248,17 @@
     handled=0;
     
     if (filter(data, "m=", &buf)) {
-      stream=sdpplin_parse_stream(&data);
+      sdpplin_stream_t *stream=sdpplin_parse_stream(&data);
 #ifdef LOG
       printf("got data for stream id %u\n", stream->stream_id);
 #endif
       if (desc->stream && (stream->stream_id >= 0) && (stream->stream_id < desc->stream_count))
       desc->stream[stream->stream_id]=stream;
       else
+      {
       mp_msg(MSGT_OPEN, MSGL_ERR, "sdpplin: got 'm=', but 'a=StreamCount' is still unknown. Broken sdp?\n");
+      free(stream);
+      }
       continue;
     }