Skip to content

Commit

Permalink
Fix memory leaks and correct one delete/delete[] missmach
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Baptiste Kempf <[email protected]>
  • Loading branch information
DanWin authored and jbkempf committed May 1, 2015
1 parent 687db10 commit 063cba9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion doc/libvlc/libvlc_DVD_ripper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion modules/access/dtv/bdagraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3370,7 +3370,7 @@ IPin* BDAGraph::FindPinOnFilter( IBaseFilter* pBaseFilter, const char* pPinName)
else
pPin = NULL; // no

delete pString;
delete[] pString;

}
else
Expand Down
5 changes: 4 additions & 1 deletion modules/access/zip/zipstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
1 change: 1 addition & 0 deletions modules/codec/quicktime.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
1 change: 1 addition & 0 deletions modules/demux/mp4/mp4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 063cba9

Please sign in to comment.