[vlc-devel] commit: Do not malloc(0) - to make valgrind not report 0 byte leaks ( Rafaël Carré )
git version control
git at videolan.org
Mon May 26 10:24:33 CEST 2008
vlc | branch: master | Rafaël Carré <funman at videolan.org> | Mon May 26 10:25:47 2008 +0200| [69b32f594f9440af60885ff4006af756b05a208b]
Do not malloc(0) - to make valgrind not report 0 byte leaks
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=69b32f594f9440af60885ff4006af756b05a208b
---
modules/demux/ts.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/modules/demux/ts.c b/modules/demux/ts.c
index 7dc07ad..c7c1447 100644
--- a/modules/demux/ts.c
+++ b/modules/demux/ts.c
@@ -3237,7 +3237,8 @@ static void PMTCallBack( demux_t *p_demux, dvbpsi_pmt_t *p_pmt )
pid->es->fmt.i_cat = SPU_ES;
pid->es->fmt.i_codec = VLC_FOURCC( 't', 'e', 'l', 'x' );
pid->es->fmt.i_extra = p_dr->i_length;
- pid->es->fmt.p_extra = malloc( p_dr->i_length );
+ pid->es->fmt.p_extra = p_dr->i_length ?
+ malloc( p_dr->i_length ) : NULL;
if( pid->es->fmt.p_extra )
memcpy( pid->es->fmt.p_extra, p_dr->p_data,
p_dr->i_length );
More information about the vlc-devel
mailing list