Commit 513a5123 authored by Rémi Duraffort's avatar Rémi Duraffort

zip: remove uneeded allocation

parent 67fcd96c
...@@ -145,24 +145,18 @@ int AccessOpen( vlc_object_t *p_this ) ...@@ -145,24 +145,18 @@ int AccessOpen( vlc_object_t *p_this )
} }
/* Define IO functions */ /* Define IO functions */
zlib_filefunc_def *p_func = (zlib_filefunc_def*) zlib_filefunc_def func;
calloc( 1, sizeof( zlib_filefunc_def ) ); func.zopen_file = ZipIO_Open;
if( unlikely( !p_func ) ) func.zread_file = ZipIO_Read;
{ func.zwrite_file = ZipIO_Write; // see comment
i_ret = VLC_ENOMEM; func.ztell_file = ZipIO_Tell;
goto exit; func.zseek_file = ZipIO_Seek;
} func.zclose_file = ZipIO_Close;
p_func->zopen_file = ZipIO_Open; func.zerror_file = ZipIO_Error;
p_func->zread_file = ZipIO_Read; func.opaque = p_access;
p_func->zwrite_file = ZipIO_Write; // see comment
p_func->ztell_file = ZipIO_Tell;
p_func->zseek_file = ZipIO_Seek;
p_func->zclose_file = ZipIO_Close;
p_func->zerror_file = ZipIO_Error;
p_func->opaque = p_access;
/* Open zip archive */ /* Open zip archive */
p_access->p_sys->zipFile = unzOpen2( psz_pathToZip, p_func ); p_access->p_sys->zipFile = unzOpen2( psz_pathToZip, &func );
if( !p_access->p_sys->zipFile ) if( !p_access->p_sys->zipFile )
{ {
msg_Err( p_access, "not a valid zip archive: '%s'", psz_pathToZip ); msg_Err( p_access, "not a valid zip archive: '%s'", psz_pathToZip );
......
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