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

access: allocate p_sys vlc_malloc/vlc_calloc

parent 9635a5c8
......@@ -341,8 +341,7 @@ static uint16_t channel_maps[] = {
static int Open (vlc_object_t *obj)
{
demux_t *demux = (demux_t *)obj;
demux_sys_t *sys = malloc (sizeof (*sys));
demux_sys_t *sys = vlc_malloc(obj, sizeof (*sys));
if (unlikely(sys == NULL))
return VLC_ENOMEM;
......@@ -361,7 +360,6 @@ static int Open (vlc_object_t *obj)
{
msg_Err (demux, "cannot open ALSA device \"%s\": %s", device,
snd_strerror (val));
free (sys);
return VLC_EGENERIC;
}
sys->pcm = pcm;
......@@ -510,7 +508,6 @@ static int Open (vlc_object_t *obj)
return VLC_SUCCESS;
error:
snd_pcm_close (pcm);
free (sys);
return VLC_EGENERIC;
}
......@@ -523,5 +520,4 @@ static void Close (vlc_object_t *obj)
vlc_join (sys->thread, NULL);
snd_pcm_close (sys->pcm);
free (sys);
}
......@@ -73,7 +73,7 @@ static int Open(vlc_object_t *object)
if (!input)
return VLC_EGENERIC;
access_sys_t *sys = malloc(sizeof (*sys));
access_sys_t *sys = vlc_malloc(object, sizeof (*sys));
if (unlikely(sys == NULL))
return VLC_ENOMEM;
......@@ -84,7 +84,6 @@ static int Open(vlc_object_t *object)
if (sys->attachment == NULL) {
msg_Err(access, "Failed to find the attachment '%s'",
access->psz_location);
free(sys);
return VLC_EGENERIC;
}
......@@ -106,7 +105,6 @@ static void Close(vlc_object_t *object)
access_sys_t *sys = access->p_sys;
vlc_input_attachment_Delete(sys->attachment);
free(sys);
}
/* */
......
......@@ -124,7 +124,7 @@ static int SetupAvioCb(vlc_object_t *access)
int OpenAvio(vlc_object_t *object)
{
access_t *access = (access_t*)object;
access_sys_t *sys = malloc(sizeof(*sys));
access_sys_t *sys = vlc_malloc(object, sizeof(*sys));
if (!sys)
return VLC_ENOMEM;
sys->context = NULL;
......@@ -140,10 +140,8 @@ int OpenAvio(vlc_object_t *object)
access->psz_location) < 0)
url = NULL;
if (!url) {
free(sys);
if (!url)
return VLC_ENOMEM;
}
/* */
vlc_init_avformat(object);
......@@ -172,7 +170,7 @@ int OpenAvio(vlc_object_t *object)
msg_Err(access, "Failed to open %s: %s", url,
vlc_strerror_c(AVUNERROR(ret)));
free(url);
goto error;
return VLC_EGENERIC;
}
free(url);
......@@ -181,7 +179,7 @@ int OpenAvio(vlc_object_t *object)
if (SetupAvioCb(VLC_OBJECT(access))) {
msg_Err(access, "Module already in use");
avio_close(sys->context);
goto error;
return VLC_EGENERIC;
}
#endif
......@@ -202,10 +200,6 @@ int OpenAvio(vlc_object_t *object)
access->p_sys = sys;
return VLC_SUCCESS;
error:
free(sys);
return VLC_EGENERIC;
}
/* */
......@@ -221,7 +215,7 @@ int OutOpenAvio(vlc_object_t *object)
config_ChainParse( access, "sout-avio-", ppsz_sout_options, access->p_cfg );
sout_access_out_sys_t *sys = malloc(sizeof(*sys));
sout_access_out_sys_t *sys = vlc_malloc(object, sizeof(*sys));
if (!sys)
return VLC_ENOMEM;
sys->context = NULL;
......@@ -230,7 +224,7 @@ int OutOpenAvio(vlc_object_t *object)
vlc_init_avformat(object);
if (!access->psz_path)
goto error;
return VLC_EGENERIC;
int ret;
#if LIBAVFORMAT_VERSION_MAJOR < 54
......@@ -252,14 +246,14 @@ int OutOpenAvio(vlc_object_t *object)
if (ret < 0) {
errno = AVUNERROR(ret);
msg_Err(access, "Failed to open %s", access->psz_path);
goto error;
return VLC_EGENERIC;
}
#if LIBAVFORMAT_VERSION_MAJOR < 54
/* We can accept only one active user at any time */
if (SetupAvioCb(VLC_OBJECT(access))) {
msg_Err(access, "Module already in use");
goto error;
return VLC_EGENERIC;
}
#endif
......@@ -269,10 +263,6 @@ int OutOpenAvio(vlc_object_t *object)
access->p_sys = sys;
return VLC_SUCCESS;
error:
free(sys);
return VLC_EGENERIC;
}
void CloseAvio(vlc_object_t *object)
......@@ -285,7 +275,6 @@ void CloseAvio(vlc_object_t *object)
#endif
avio_close(sys->context);
free(sys);
}
void OutCloseAvio(vlc_object_t *object)
......@@ -298,7 +287,6 @@ void OutCloseAvio(vlc_object_t *object)
#endif
avio_close(sys->context);
free(sys);
}
static ssize_t Read(access_t *access, void *data, size_t size)
......
......@@ -653,7 +653,7 @@ static int blurayOpen(vlc_object_t *object)
}
/* */
p_demux->p_sys = p_sys = calloc(1, sizeof(*p_sys));
p_demux->p_sys = p_sys = vlc_calloc(obj, 1, sizeof(*p_sys));
if (unlikely(!p_sys))
return VLC_ENOMEM;
......@@ -902,7 +902,6 @@ static void blurayClose(vlc_object_t *object)
vlc_mutex_destroy(&p_sys->read_block_lock);
free(p_sys->psz_bd_path);
free(p_sys);
}
/*****************************************************************************
......
......@@ -223,17 +223,11 @@ static int DemuxOpen(vlc_object_t *obj)
return VLC_EGENERIC;
if (track == 0 /* Whole disc -> use access plugin */)
{
ioctl_Close(obj, dev);
return VLC_EGENERIC;
}
goto error;
demux_sys_t *sys = malloc(sizeof (*sys));
demux_sys_t *sys = vlc_malloc(obj, sizeof (*sys));
if (unlikely(sys == NULL))
{
ioctl_Close(obj, dev);
return VLC_ENOMEM;
}
goto error;
demux->p_sys = sys;
sys->vcddev = dev;
......@@ -275,7 +269,6 @@ static int DemuxOpen(vlc_object_t *obj)
error:
ioctl_Close(obj, dev);
free(sys);
return VLC_EGENERIC;
}
......@@ -285,7 +278,6 @@ static void DemuxClose(vlc_object_t *obj)
demux_sys_t *sys = demux->p_sys;
ioctl_Close(obj, sys->vcddev);
free(sys);
}
/*****************************************************************************
......@@ -628,7 +620,7 @@ static int AccessOpen(vlc_object_t *obj)
return VLC_EGENERIC;
}
access_sys_t *sys = malloc(sizeof (*sys));
access_sys_t *sys = vlc_malloc(obj, sizeof (*sys));
if (unlikely(sys == NULL))
{
ioctl_Close(obj, dev);
......@@ -679,7 +671,6 @@ static int AccessOpen(vlc_object_t *obj)
error:
free(sys->p_sectors);
ioctl_Close(obj, dev);
free(sys);
return VLC_EGENERIC;
}
......@@ -703,7 +694,6 @@ static void AccessClose(vlc_object_t *obj)
free(sys->p_sectors);
ioctl_Close(obj, sys->vcddev);
free(sys);
}
/*****************************************************************************
......
......@@ -188,7 +188,7 @@ static int Open(vlc_object_t *obj)
if (list == NULL)
return VLC_EGENERIC;
access_sys_t *sys = malloc(sizeof (*sys));
access_sys_t *sys = vlc_malloc(obj, sizeof (*sys));
if (unlikely(sys == NULL))
{
free(list);
......@@ -298,7 +298,6 @@ static void Close(vlc_object_t *obj)
}
var_Destroy(access, "concat-list");
free(sys);
}
#define INPUT_LIST_TEXT N_("Inputs list")
......
......@@ -176,7 +176,7 @@ static int Open( vlc_object_t *p_this )
p_demux->info.i_title = 0;
p_demux->info.i_seekpoint = 0;
p_demux->p_sys = p_sys = calloc( 1, sizeof( demux_sys_t ) );
p_demux->p_sys = p_sys = vlc_calloc( p_this, 1, sizeof( demux_sys_t ) );
if( !p_sys )
return VLC_ENOMEM;
......@@ -201,7 +201,6 @@ static int Open( vlc_object_t *p_this )
msg_Err( p_demux, "Bad MRL, please check the option line "
"(MRL was: %s)",
p_demux->psz_location );
free( p_sys );
return VLC_EGENERIC;
}
......@@ -209,14 +208,12 @@ static int Open( vlc_object_t *p_this )
if( !p_sys->p_dccontext )
{
msg_Err( p_demux, "Failed to initialise libdc1394");
free( p_sys );
return VLC_EGENERIC;
}
if( FindCamera( p_sys, p_demux ) != VLC_SUCCESS )
{
dc1394_free( p_sys->p_dccontext );
free( p_sys );
return VLC_EGENERIC;
}
......@@ -224,7 +221,6 @@ static int Open( vlc_object_t *p_this )
{
msg_Err( p_demux, "No camera found !!" );
dc1394_free( p_sys->p_dccontext );
free( p_sys );
return VLC_EGENERIC;
}
......@@ -390,7 +386,6 @@ static void Close( vlc_object_t *p_this )
dc1394_free(p_sys->p_dccontext);
free( p_sys->video_device );
free( p_sys );
}
#if 0
......
......@@ -53,7 +53,7 @@ struct access_sys_t
*****************************************************************************/
int DirInit (access_t *access, DIR *dir)
{
access_sys_t *sys = malloc(sizeof (*sys));
access_sys_t *sys = vlc_malloc(VLC_OBJECT(access), sizeof (*sys));
if (unlikely(sys == NULL))
goto error;
......@@ -77,7 +77,6 @@ int DirInit (access_t *access, DIR *dir)
error:
closedir(dir);
free(sys);
return VLC_ENOMEM;
}
......@@ -108,7 +107,6 @@ void DirClose(vlc_object_t *obj)
free(sys->base_uri);
closedir(sys->dir);
free(sys);
}
int DirRead (access_t *access, input_item_node_t *node)
......
......@@ -128,7 +128,7 @@ static int Open( vlc_object_t *p_this )
/* Set up p_access */
ACCESS_SET_CALLBACKS( NULL, Block, Control, NULL );
p_access->p_sys = p_sys = malloc( sizeof( access_sys_t ) );
p_access->p_sys = p_sys = vlc_malloc( p_this, sizeof( access_sys_t ) );
if( !p_sys )
return VLC_EGENERIC;
......@@ -259,7 +259,6 @@ static void Close( vlc_object_t *p_this )
AVCClose( p_access );
vlc_mutex_destroy( &p_sys->lock );
free( p_sys );
}
/*****************************************************************************
......
......@@ -211,7 +211,7 @@ int FileOpen( vlc_object_t *p_this )
#endif
}
access_sys_t *p_sys = malloc (sizeof (*p_sys));
access_sys_t *p_sys = vlc_malloc(p_this, sizeof (*p_sys));
if (unlikely(p_sys == NULL))
goto error;
p_access->pf_read = Read;
......@@ -268,7 +268,6 @@ void FileClose (vlc_object_t * p_this)
access_sys_t *p_sys = p_access->p_sys;
vlc_close (p_sys->fd);
free (p_sys);
}
......
......@@ -669,7 +669,7 @@ static int InOpen( vlc_object_t *p_this )
bool b_directory;
/* Init p_access */
p_sys = p_access->p_sys = (access_sys_t*)calloc( 1, sizeof( access_sys_t ) );
p_sys = p_access->p_sys = (access_sys_t*)vlc_calloc( p_this, 1, sizeof( access_sys_t ) );
if( !p_sys )
return VLC_ENOMEM;
p_sys->data = NULL;
......@@ -746,7 +746,6 @@ error:
exit_error:
vlc_UrlClean( &p_sys->url );
vlc_tls_Delete( p_sys->p_creds );
free( p_sys );
return VLC_EGENERIC;
}
......@@ -756,7 +755,7 @@ static int OutOpen( vlc_object_t *p_this )
sout_access_out_t *p_access = (sout_access_out_t *)p_this;
access_sys_t *p_sys;
p_sys = calloc( 1, sizeof( *p_sys ) );
p_sys = vlc_calloc( p_this, 1, sizeof( *p_sys ) );
if( !p_sys )
return VLC_ENOMEM;
......@@ -795,7 +794,6 @@ static int OutOpen( vlc_object_t *p_this )
exit_error:
vlc_UrlClean( &p_sys->url );
vlc_tls_Delete( p_sys->p_creds );
free( p_sys );
return VLC_EGENERIC;
}
#endif
......@@ -822,7 +820,6 @@ static void Close( vlc_object_t *p_access, access_sys_t *p_sys )
/* free memory */
vlc_UrlClean( &p_sys->url );
vlc_tls_Delete( p_sys->p_creds );
free( p_sys );
}
static void InClose( vlc_object_t *p_this )
......
......@@ -157,7 +157,7 @@ static int Open( vlc_object_t *p_this )
int ret = VLC_EGENERIC;
vlc_credential credential;
access_sys_t *p_sys = malloc( sizeof(*p_sys) );
access_sys_t *p_sys = vlc_malloc( p_this, sizeof(*p_sys) );
if( unlikely(p_sys == NULL) )
return VLC_ENOMEM;
......@@ -185,7 +185,6 @@ static int Open( vlc_object_t *p_this )
{
msg_Err( p_access, "invalid URL" );
vlc_UrlClean( &p_sys->url );
free( p_sys );
return VLC_EGENERIC;
}
if( p_sys->url.i_port <= 0 )
......@@ -376,7 +375,6 @@ error:
Disconnect( p_access );
free( p_sys );
return ret;
}
......@@ -407,8 +405,6 @@ static void Close( vlc_object_t *p_this )
free( p_sys->psz_password );
Disconnect( p_access );
free( p_sys );
}
/* Read data from the socket */
......
......@@ -42,7 +42,7 @@ vlc_module_begin ()
set_shortname( N_("Dummy") )
set_description( N_("Dummy input") )
set_capability( "access_demux", 0 )
set_callbacks( OpenDemux, CloseDemux )
set_callbacks( OpenDemux, NULL )
add_shortcut( "dummy", "vlc" )
vlc_module_end ()
......@@ -185,7 +185,7 @@ nop:
if( length == 0 )
goto nop; /* avoid division by zero */
demux_sys_t *p_sys = malloc( sizeof( *p_sys ) );
demux_sys_t *p_sys = vlc_malloc( p_this, sizeof( *p_sys ) );
if( p_sys == NULL )
return VLC_ENOMEM;
......@@ -202,16 +202,6 @@ nop:
return VLC_EGENERIC;
}
/*****************************************************************************
* CloseDemux: initialize the target, ie. parse the command
*****************************************************************************/
static void CloseDemux( vlc_object_t *p_this )
{
demux_t *p_demux = (demux_t*)p_this;
free( p_demux->p_sys );
}
static int DemuxControl( demux_t *p_demux, int i_query, va_list args )
{
(void)p_demux; (void)i_query; (void)args;
......
......@@ -112,7 +112,7 @@ static int Open(vlc_object_t *object)
{
access_t *access = (access_t *)object;
access_sys_t *sys = malloc(sizeof (*sys));
access_sys_t *sys = vlc_malloc(object, sizeof (*sys));
if (unlikely(sys == NULL))
return VLC_ENOMEM;
......@@ -130,11 +130,11 @@ static int Open(vlc_object_t *object)
if (open_cb == NULL)
open_cb = open_cb_default;
if (sys->read_cb == NULL)
goto error;
return VLC_EGENERIC;
if (open_cb(opaque, &sys->opaque, &sys->size)) {
msg_Err(access, "open error");
goto error;
return VLC_EGENERIC;
}
access->pf_read = Read;
......@@ -144,9 +144,6 @@ static int Open(vlc_object_t *object)
access->p_sys = sys;
return VLC_SUCCESS;
error:
free(sys);
return VLC_EGENERIC;
}
static void Close(vlc_object_t *object)
......@@ -156,7 +153,6 @@ static void Close(vlc_object_t *object)
if (sys->close_cb != NULL)
sys->close_cb(sys->opaque);
free(sys);
}
vlc_module_begin()
......
......@@ -230,7 +230,6 @@ static void ParseMRL(vlc_object_t *, const char *);
static void CloseCommon(imem_sys_t *sys)
{
free(sys->source.cookie);
free(sys);
}
/**
......@@ -241,7 +240,7 @@ static int OpenCommon(vlc_object_t *object, imem_sys_t **sys_ptr, const char *ps
char *tmp;
/* */
imem_sys_t *sys = calloc(1, sizeof(*sys));
imem_sys_t *sys = vlc_calloc(object, 1, sizeof(*sys));
if (!sys)
return VLC_ENOMEM;
......
......@@ -131,7 +131,7 @@ static int Open( vlc_object_t *p_this )
p_demux->pf_control = Control;
/* Allocate structure */
p_demux->p_sys = p_sys = calloc( 1, sizeof( demux_sys_t ) );
p_demux->p_sys = p_sys = vlc_calloc( p_this, 1, sizeof( demux_sys_t ) );
if( !p_sys )
return VLC_ENOMEM;
......@@ -152,7 +152,6 @@ static int Open( vlc_object_t *p_this )
if( p_sys->p_jack_client == NULL )
{
msg_Err( p_demux, "failed to connect to JACK server" );
free( p_sys );
return VLC_EGENERIC;
}
......@@ -173,7 +172,6 @@ static int Open( vlc_object_t *p_this )
if( p_sys->pp_jack_port_input == NULL )
{
jack_client_close( p_sys->p_jack_client );
free( p_sys );
return VLC_ENOMEM;
}
......@@ -187,7 +185,6 @@ static int Open( vlc_object_t *p_this )
{
free( p_sys->pp_jack_port_input );
jack_client_close( p_sys->p_jack_client );
free( p_sys );
return VLC_ENOMEM;
}
......@@ -205,7 +202,6 @@ static int Open( vlc_object_t *p_this )
jack_ringbuffer_free( p_sys->p_jack_ringbuffer );
free( p_sys->pp_jack_port_input );
jack_client_close( p_sys->p_jack_client );
free( p_sys );
return VLC_EGENERIC;
}
}
......@@ -220,7 +216,6 @@ static int Open( vlc_object_t *p_this )
jack_ringbuffer_free( p_sys->p_jack_ringbuffer );
free( p_sys->pp_jack_port_input );
jack_client_close( p_sys->p_jack_client );
free( p_sys );
return VLC_ENOMEM;
}
......@@ -237,7 +232,6 @@ static int Open( vlc_object_t *p_this )
jack_ringbuffer_free( p_sys->p_jack_ringbuffer );
free( p_sys->pp_jack_port_input );
jack_client_close( p_sys->p_jack_client );
free( p_sys );
return VLC_EGENERIC;
}
......@@ -314,7 +308,6 @@ static void Close( vlc_object_t *p_this )
free( p_sys->pp_jack_port_input );
free( p_sys->pp_jack_buffer );
free( p_sys->pp_jack_port_table );
free( p_sys );
}
......
......@@ -621,10 +621,10 @@ static int
Open(vlc_object_t *p_obj)
{
access_t *p_access = (access_t *)p_obj;
access_sys_t *p_sys = calloc(1, sizeof (*p_sys));
access_sys_t *p_sys = vlc_calloc(p_obj, 1, sizeof (*p_sys));
if (unlikely(p_sys == NULL))
goto error;
return VLC_ENOMEM;
p_access->p_sys = p_sys;
p_sys->b_auto_guid = var_InheritBool(p_obj, "nfs-auto-guid");
......@@ -770,5 +770,4 @@ Close(vlc_object_t *p_obj)
free(p_sys->psz_url_decoded);
free(p_sys->psz_url_decoded_slash);
free(p_sys);
}
......@@ -160,7 +160,7 @@ static int DemuxOpen( vlc_object_t *p_this )
p_demux->info.i_title = 0;
p_demux->info.i_seekpoint = 0;
p_demux->p_sys = p_sys = calloc( 1, sizeof( demux_sys_t ) );
p_demux->p_sys = p_sys = vlc_calloc( p_this, 1, sizeof( demux_sys_t ) );
if( p_sys == NULL ) return VLC_ENOMEM;
p_sys->i_sample_rate = var_InheritInteger( p_demux, CFG_PREFIX "samplerate" );
......@@ -196,7 +196,6 @@ static void DemuxClose( vlc_object_t *p_this )
vlc_close( p_sys->i_fd );
if( p_sys->p_block ) block_Release( p_sys->p_block );
free( p_sys );
}
/*****************************************************************************
......
......@@ -255,15 +255,13 @@ static int Open(vlc_object_t *obj)
{
demux_t *demux = (demux_t *)obj;
demux_sys_t *sys = malloc(sizeof (*sys));
demux_sys_t *sys = vlc_malloc(obj, sizeof (*sys));
if (unlikely(sys == NULL))
return VLC_ENOMEM;
sys->context = vlc_pa_connect(obj, &sys->mainloop);
if (sys->context == NULL) {
free(sys);
if (sys->context == NULL)
return VLC_EGENERIC;
}
sys->stream = NULL;
sys->es = NULL;
......@@ -396,5 +394,4 @@ static void Close (vlc_object_t *obj)
}
vlc_pa_disconnect(obj, sys->context, sys->mainloop);
free(sys);
}
......@@ -425,7 +425,7 @@ static int Open( vlc_object_t *p_this )
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
p_sys = calloc( 1, sizeof(demux_sys_t) );
p_sys = vlc_calloc( p_this, 1, sizeof(demux_sys_t) );
if( !p_sys ) return VLC_ENOMEM;
p_sys->f_fps = var_InheritFloat( p_demux, CFG_PREFIX "fps" );
......@@ -440,7 +440,6 @@ static int Open( vlc_object_t *p_this )
if ( !p_sys->p_instance )
{
msg_Err( p_demux, "rdp instantiation error" );
free( p_sys );
return VLC_EGENERIC;
}
......@@ -490,7 +489,6 @@ static int Open( vlc_object_t *p_this )
error:
freerdp_free( p_sys->p_instance );
free( p_sys->psz_hostname );
free( p_sys );
return VLC_EGENERIC;
}
......@@ -518,5 +516,4 @@ static void Close( vlc_object_t *p_this )
block_Release( p_sys->p_block );
free( p_sys->psz_hostname );
free( p_sys );
}
......@@ -626,7 +626,7 @@ static int satip_open(vlc_object_t *obj)
bool multicast = var_InheritBool(access, "satip-multicast");
access->p_sys = sys = calloc(1, sizeof(*sys));
access->p_sys = sys = vlc_calloc(obj, 1, sizeof(*sys));
if (sys == NULL)
return VLC_ENOMEM;
......@@ -804,7 +804,6 @@ error:
free(sys->content_base);
free(sys->control);
free(sys);
return VLC_EGENERIC;
}
......@@ -824,5 +823,4 @@ static void satip_close(vlc_object_t *obj)
net_Close(sys->tcp_sock);
free(sys->content_base);
free(sys->control);
free(sys);
}
......@@ -27,7 +27,6 @@
#include <vlc_access.h>
static int Open (vlc_object_t *);
static void Close (vlc_object_t *);
vlc_module_begin ()
set_shortname (N_("SDP"))
......@@ -36,7 +35,7 @@ vlc_module_begin ()
set_subcategory (SUBCAT_INPUT_ACCESS)
set_capability ("access", 0)
set_callbacks (Open, Close)
set_callbacks (Open, NULL)
add_shortcut ("sdp")
vlc_module_end()
......@@ -56,7 +55,7 @@ static int Open (vlc_object_t *obj)
access_t *access = (access_t *)obj;
size_t len = strlen (access->psz_location);
access_sys_t *sys = malloc (sizeof(*sys) + len);
access_sys_t *sys = vlc_malloc(obj, sizeof(*sys) + len);
if (unlikely(sys == NULL))
return VLC_ENOMEM;
......@@ -74,14 +73,6 @@ static int Open (vlc_object_t *obj)
return VLC_SUCCESS;
}
static void Close (vlc_object_t *obj)
{
access_t *access = (access_t *)obj;
access_sys_t *sys = access->p_sys;
free (sys);
}
static ssize_t Read (access_t *access, void *buf, size_t len)
{
access_sys_t *sys = access->p_sys;
......
......@@ -197,7 +197,7 @@ static int Open( vlc_object_t* p_this )
if( !p_access->psz_location )
return VLC_EGENERIC;
p_sys = p_access->p_sys = (access_sys_t*)calloc( 1, sizeof( access_sys_t ) );
p_sys = p_access->p_sys = vlc_calloc( p_this, 1, sizeof( access_sys_t ) );
if( !p_sys ) return VLC_ENOMEM;