[vlc-devel] commit: Check malloc return value. ( Rémi Duraffort )

git version control git at videolan.org
Thu Aug 14 23:20:22 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Thu Aug 14 22:41:08 2008 +0200| [2aab2631f63f37bd4c440741e7cc0057f6f98746] | committer: Rémi Duraffort 

Check malloc return value.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2aab2631f63f37bd4c440741e7cc0057f6f98746
---

 modules/access/dshow/dshow.cpp |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/modules/access/dshow/dshow.cpp b/modules/access/dshow/dshow.cpp
index 128ed49..7832a98 100644
--- a/modules/access/dshow/dshow.cpp
+++ b/modules/access/dshow/dshow.cpp
@@ -578,6 +578,8 @@ static int DemuxOpen( vlc_object_t *p_this )
     int i;
 
     p_sys = (access_sys_t *)malloc( sizeof( access_sys_t ) );
+    if( !p_sys )
+        return VLC_ENOMEM;
     memset( p_sys, 0, sizeof( access_sys_t ) );
     p_demux->p_sys = (demux_sys_t *)p_sys;
 
@@ -660,6 +662,8 @@ static int AccessOpen( vlc_object_t *p_this )
     access_sys_t *p_sys;
 
     p_access->p_sys = p_sys = (access_sys_t *)malloc( sizeof( access_sys_t ) );
+    if( !p_sys )
+        return VLC_ENOMEM;
     memset( p_sys, 0, sizeof( access_sys_t ) );
 
     if( CommonOpen( p_this, p_sys, false ) != VLC_SUCCESS )




More information about the vlc-devel mailing list