[vlc-devel] commit: Fix mem leak (Christophe Mutricy )

git version control git at videolan.org
Sat Nov 22 18:03:45 CET 2008


vlc | branch: master | Christophe Mutricy <xtophe at videolan.org> | Sat Nov 22 16:04:24 2008 +0000| [aa79a7b23841cd0a7b7ac8c4426ba191d5115e01] | committer: Christophe Mutricy 

Fix mem leak

Closes #2305

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=aa79a7b23841cd0a7b7ac8c4426ba191d5115e01
---

 modules/access/rtsp/real_sdpplin.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/access/rtsp/real_sdpplin.c b/modules/access/rtsp/real_sdpplin.c
index 229501c..be950c2 100644
--- a/modules/access/rtsp/real_sdpplin.c
+++ b/modules/access/rtsp/real_sdpplin.c
@@ -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 );




More information about the vlc-devel mailing list