Commit 0bc96b8b authored by Erwan Tulou's avatar Erwan Tulou

zipaccess: correct memory leak (probing work moved before calloc)

(cherry picked from commit 7b7421e9)
parent 1395c868
...@@ -105,6 +105,12 @@ int AccessOpen( vlc_object_t *p_this ) ...@@ -105,6 +105,12 @@ int AccessOpen( vlc_object_t *p_this )
char *psz_pathToZip = NULL, *psz_path = NULL, *psz_sep = NULL; char *psz_pathToZip = NULL, *psz_path = NULL, *psz_sep = NULL;
if( !strstr( p_access->psz_path, ZIP_SEP ) )
{
msg_Dbg( p_access, "path does not contain separator " ZIP_SEP );
return VLC_EGENERIC;
}
p_access->p_sys = p_sys = (access_sys_t*) p_access->p_sys = p_sys = (access_sys_t*)
calloc( 1, sizeof( access_sys_t ) ); calloc( 1, sizeof( access_sys_t ) );
if( !p_sys ) if( !p_sys )
...@@ -113,11 +119,6 @@ int AccessOpen( vlc_object_t *p_this ) ...@@ -113,11 +119,6 @@ int AccessOpen( vlc_object_t *p_this )
/* Split the MRL */ /* Split the MRL */
psz_path = strdup( p_access->psz_path ); psz_path = strdup( p_access->psz_path );
psz_sep = strstr( psz_path, ZIP_SEP ); psz_sep = strstr( psz_path, ZIP_SEP );
if( !psz_sep )
{
msg_Dbg( p_access, "path does not contain separator " ZIP_SEP );
return VLC_EGENERIC;
}
*psz_sep = '\0'; *psz_sep = '\0';
psz_pathToZip = unescapeXml( psz_path ); psz_pathToZip = unescapeXml( psz_path );
......
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