]> git.sesse.net Git - vlc/commitdiff
Fix mem leak
authorChristophe Mutricy <xtophe@videolan.org>
Sat, 22 Nov 2008 16:04:24 +0000 (16:04 +0000)
committerChristophe Mutricy <xtophe@videolan.org>
Sat, 22 Nov 2008 16:04:24 +0000 (16:04 +0000)
Closes #2305

modules/access/rtsp/real_sdpplin.c

index 229501cb6b152c8600eebc430de428b89d8745bd..be950c2f07d9ea409ccd829abeef31e7ddf326df 100644 (file)
@@ -231,16 +231,18 @@ sdpplin_t *sdpplin_parse(char *data) {
 
   sdpplin_t        *desc = malloc(sizeof(sdpplin_t));
   sdpplin_stream_t *stream;
-  char             *buf=malloc(BUFLEN);
-  char             *decoded=malloc(BUFLEN);
+  char             *buf=NULL;
+  char             *decoded=NULL;
   int              handled;
   int              len;
 
   if( !desc ) return NULL;
+  buf = malloc(BUFLEN);
   if( !buf ) {
     free( desc );
     return NULL;
   }
+  decoded = malloc(BUFLEN);
   if( !decoded ) {
     free( buf );
     free( desc );