Commit 063cba9f authored by Daniel Winzen's avatar Daniel Winzen Committed by Jean-Baptiste Kempf

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

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 687db106
...@@ -155,7 +155,10 @@ void on_run(GtkWidget *widget, gpointer data) { ...@@ -155,7 +155,10 @@ void on_run(GtkWidget *widget, gpointer data) {
transcode = get_transcode_string(preset); transcode = get_transcode_string(preset);
free(preset); free(preset);
sout = malloc((strlen(transcode)+strlen(file_begin)+strlen(dest)+strlen(file_end)+1) * sizeof(char)); 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); strncpy(sout, transcode, strlen(transcode)+1);
strncat(sout, file_begin, strlen(file_begin)); strncat(sout, file_begin, strlen(file_begin));
strncat(sout, dest, strlen(dest)); strncat(sout, dest, strlen(dest));
......
...@@ -3370,7 +3370,7 @@ IPin* BDAGraph::FindPinOnFilter( IBaseFilter* pBaseFilter, const char* pPinName) ...@@ -3370,7 +3370,7 @@ IPin* BDAGraph::FindPinOnFilter( IBaseFilter* pBaseFilter, const char* pPinName)
else else
pPin = NULL; // no pPin = NULL; // no
delete pString; delete[] pString;
} }
else else
......
...@@ -575,7 +575,10 @@ static int WriteXSPF( char **pp_buffer, vlc_array_t *p_filenames, ...@@ -575,7 +575,10 @@ static int WriteXSPF( char **pp_buffer, vlc_array_t *p_filenames,
/* Encode the URI and append ZIP_SEP */ /* Encode the URI and append ZIP_SEP */
char *psz_pathtozip; char *psz_pathtozip;
escapeToXml( &psz_pathtozip, psz_zippath ); 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; int i_track = 0;
for( int i = 0; i < vlc_array_count( p_filenames ); ++i ) for( int i = 0; i < vlc_array_count( p_filenames ); ++i )
......
...@@ -803,6 +803,7 @@ static int OpenVideo( decoder_t *p_dec ) ...@@ -803,6 +803,7 @@ static int OpenVideo( decoder_t *p_dec )
p_sys->framedescHandle = (ImageDescriptionHandle) NewHandleClear( id->idSize ); p_sys->framedescHandle = (ImageDescriptionHandle) NewHandleClear( id->idSize );
memcpy( *p_sys->framedescHandle, id, 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) 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 ); p_sys->plane = malloc( p_dec->fmt_in.video.i_width * p_dec->fmt_in.video.i_height * 3 );
......
...@@ -4460,6 +4460,7 @@ static mp4_fragment_t * GetFragmentByTime( demux_t *p_demux, const mtime_t i_tim ...@@ -4460,6 +4460,7 @@ static mp4_fragment_t * GetFragmentByTime( demux_t *p_demux, const mtime_t i_tim
if ( i_time >= i_base_time && if ( i_time >= i_base_time &&
i_time <= i_base_time + i_length ) i_time <= i_base_time + i_length )
{ {
free( pi_tracks_duration_total );
return p_fragment; return p_fragment;
} }
else else
......
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