1
mirror of https://code.videolan.org/videolan/vlc synced 2024-09-04 09:11:33 +02:00

Fix memory leaks and correct one delete/delete[] missmach

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
This commit is contained in:
Daniel Winzen 2015-04-30 18:30:14 +00:00 committed by Jean-Baptiste Kempf
parent 687db1064b
commit 063cba9f02
5 changed files with 11 additions and 3 deletions

View File

@ -155,7 +155,10 @@ void on_run(GtkWidget *widget, gpointer data) {
transcode = get_transcode_string(preset);
free(preset);
sout = malloc((strlen(transcode)+strlen(file_begin)+strlen(dest)+strlen(file_end)+1) * sizeof(char));
if(sout == NULL) return;
if(sout == NULL) {
free(handle);
return;
}
strncpy(sout, transcode, strlen(transcode)+1);
strncat(sout, file_begin, strlen(file_begin));
strncat(sout, dest, strlen(dest));

View File

@ -3370,7 +3370,7 @@ IPin* BDAGraph::FindPinOnFilter( IBaseFilter* pBaseFilter, const char* pPinName)
else
pPin = NULL; // no
delete pString;
delete[] pString;
}
else

View File

@ -575,7 +575,10 @@ static int WriteXSPF( char **pp_buffer, vlc_array_t *p_filenames,
/* Encode the URI and append ZIP_SEP */
char *psz_pathtozip;
escapeToXml( &psz_pathtozip, psz_zippath );
if( astrcatf( &psz_pathtozip, "%s", ZIP_SEP ) < 0 ) return -1;
if( astrcatf( &psz_pathtozip, "%s", ZIP_SEP ) < 0 ) {
free_all_node( playlist );
return -1;
}
int i_track = 0;
for( int i = 0; i < vlc_array_count( p_filenames ); ++i )

View File

@ -803,6 +803,7 @@ static int OpenVideo( decoder_t *p_dec )
p_sys->framedescHandle = (ImageDescriptionHandle) NewHandleClear( id->idSize );
memcpy( *p_sys->framedescHandle, id, id->idSize );
free( id );
if( p_dec->fmt_in.video.i_width != 0 && p_dec->fmt_in.video.i_height != 0)
p_sys->plane = malloc( p_dec->fmt_in.video.i_width * p_dec->fmt_in.video.i_height * 3 );

View File

@ -4460,6 +4460,7 @@ static mp4_fragment_t * GetFragmentByTime( demux_t *p_demux, const mtime_t i_tim
if ( i_time >= i_base_time &&
i_time <= i_base_time + i_length )
{
free( pi_tracks_duration_total );
return p_fragment;
}
else