Commit b23f06cf authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

mmsh: fix memory leak

parent 77c9ae04
...@@ -638,6 +638,7 @@ static int Describe( access_t *p_access, char **ppsz_location ) ...@@ -638,6 +638,7 @@ static int Describe( access_t *p_access, char **ppsz_location )
if( psz == NULL ) if( psz == NULL )
{ {
msg_Err( p_access, "failed to read answer" ); msg_Err( p_access, "failed to read answer" );
free( psz_location );
goto error; goto error;
} }
...@@ -651,6 +652,7 @@ static int Describe( access_t *p_access, char **ppsz_location ) ...@@ -651,6 +652,7 @@ static int Describe( access_t *p_access, char **ppsz_location )
{ {
msg_Err( p_access, "malformed header line: %s", psz ); msg_Err( p_access, "malformed header line: %s", psz );
free( psz ); free( psz );
free( psz_location );
goto error; goto error;
} }
*p++ = '\0'; *p++ = '\0';
...@@ -682,6 +684,7 @@ static int Describe( access_t *p_access, char **ppsz_location ) ...@@ -682,6 +684,7 @@ static int Describe( access_t *p_access, char **ppsz_location )
} }
else if( !strcasecmp( psz, "Location" ) ) else if( !strcasecmp( psz, "Location" ) )
{ {
free( psz_location );
psz_location = strdup( p ); psz_location = strdup( p );
} }
else if( !strcasecmp( psz, "Content-Length" ) ) else if( !strcasecmp( psz, "Content-Length" ) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment