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

Call aout_PacketDestroy() on error paths too

aout_PacketInit() does not allocate anything yet, but it will have too.

By the way, the error paths of the (untouched by the commit)
DirectSound plugin seem a bit suspicious to me...
parent d7143389
...@@ -501,6 +501,7 @@ static int Open (vlc_object_t *obj) ...@@ -501,6 +501,7 @@ static int Open (vlc_object_t *obj)
VLC_THREAD_PRIORITY_OUTPUT ) ) VLC_THREAD_PRIORITY_OUTPUT ) )
{ {
msg_Err( p_aout, "cannot create ALSA thread (%m)" ); msg_Err( p_aout, "cannot create ALSA thread (%m)" );
aout_PacketDestroy (p_aout);
vlc_sem_destroy( &p_sys->wait ); vlc_sem_destroy( &p_sys->wait );
goto error; goto error;
} }
......
...@@ -796,6 +796,7 @@ static int OpenSPDIF( audio_output_t * p_aout ) ...@@ -796,6 +796,7 @@ static int OpenSPDIF( audio_output_t * p_aout )
if( err != noErr ) if( err != noErr )
{ {
msg_Err( p_aout, "AudioDeviceCreateIOProcID failed: [%4.4s]", (char *)&err ); msg_Err( p_aout, "AudioDeviceCreateIOProcID failed: [%4.4s]", (char *)&err );
aout_PacketDestroy (p_aout);
return false; return false;
} }
...@@ -816,6 +817,7 @@ static int OpenSPDIF( audio_output_t * p_aout ) ...@@ -816,6 +817,7 @@ static int OpenSPDIF( audio_output_t * p_aout )
{ {
msg_Err( p_aout, "AudioDeviceDestroyIOProcID failed: [%4.4s]", (char *)&err ); msg_Err( p_aout, "AudioDeviceDestroyIOProcID failed: [%4.4s]", (char *)&err );
} }
aout_PacketDestroy (p_aout);
return false; return false;
} }
......
...@@ -236,6 +236,7 @@ error_out: ...@@ -236,6 +236,7 @@ error_out:
{ {
jack_deactivate( p_sys->p_jack_client ); jack_deactivate( p_sys->p_jack_client );
jack_client_close( p_sys->p_jack_client ); jack_client_close( p_sys->p_jack_client );
aout_PacketDestroy( p_aout );
} }
free( p_sys->p_jack_ports ); free( p_sys->p_jack_ports );
free( p_sys->p_jack_buffers ); free( p_sys->p_jack_buffers );
......
...@@ -508,6 +508,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -508,6 +508,7 @@ static int Open( vlc_object_t *p_this )
{ {
msg_Err( p_aout, "cannot create OSS thread (%m)" ); msg_Err( p_aout, "cannot create OSS thread (%m)" );
close( p_sys->i_fd ); close( p_sys->i_fd );
aout_PacketDestroy( p_aout );
free( p_sys ); free( p_sys );
return VLC_ENOMEM; return VLC_ENOMEM;
} }
......
...@@ -544,6 +544,7 @@ static int PAOpenStream( audio_output_t *p_aout ) ...@@ -544,6 +544,7 @@ static int PAOpenStream( audio_output_t *p_aout )
paLastHostErrorInfo->errorText ); paLastHostErrorInfo->errorText );
} }
p_sys->p_stream = 0; p_sys->p_stream = 0;
aout_PacketDestroy( p_aout );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -552,6 +553,7 @@ static int PAOpenStream( audio_output_t *p_aout ) ...@@ -552,6 +553,7 @@ static int PAOpenStream( audio_output_t *p_aout )
{ {
msg_Err( p_aout, "Pa_StartStream() failed" ); msg_Err( p_aout, "Pa_StartStream() failed" );
Pa_CloseStream( p_sys->p_stream ); Pa_CloseStream( p_sys->p_stream );
aout_PacketDestroy( p_aout );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
......
...@@ -311,6 +311,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -311,6 +311,7 @@ static int Open( vlc_object_t *p_this )
malloc( p_aout->sys->i_buffer_size ); malloc( p_aout->sys->i_buffer_size );
if( p_aout->sys->p_silence_buffer == NULL ) if( p_aout->sys->p_silence_buffer == NULL )
{ {
aout_PacketDestroy( p_aout );
free( p_aout->sys ); free( p_aout->sys );
return VLC_ENOMEM; return VLC_ENOMEM;
} }
......
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