[vlc-commits] mmsh: fix memory leak

Rémi Denis-Courmont git at videolan.org
Sat Aug 22 09:34:41 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Aug 22 10:34:33 2015 +0300| [b23f06cfa468ff64d98654684e9eb2e044c37c75] | committer: Rémi Denis-Courmont

mmsh: fix memory leak

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

 modules/access/mms/mmsh.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/access/mms/mmsh.c b/modules/access/mms/mmsh.c
index d7d38f6..1d04e71 100644
--- a/modules/access/mms/mmsh.c
+++ b/modules/access/mms/mmsh.c
@@ -638,6 +638,7 @@ static int Describe( access_t  *p_access, char **ppsz_location )
         if( psz == NULL )
         {
             msg_Err( p_access, "failed to read answer" );
+            free( psz_location );
             goto error;
         }
 
@@ -651,6 +652,7 @@ static int Describe( access_t  *p_access, char **ppsz_location )
         {
             msg_Err( p_access, "malformed header line: %s", psz );
             free( psz );
+            free( psz_location );
             goto error;
         }
         *p++ = '\0';
@@ -682,6 +684,7 @@ static int Describe( access_t  *p_access, char **ppsz_location )
         }
         else if( !strcasecmp( psz, "Location" ) )
         {
+            free( psz_location );
             psz_location = strdup( p );
         }
         else if( !strcasecmp( psz, "Content-Length" ) )



More information about the vlc-commits mailing list