[vlc-devel] commit: Check malloc return value. ( Rémi Duraffort )
git version control
git at videolan.org
Fri Aug 15 21:54:40 CEST 2008
vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Fri Aug 15 10:02:41 2008 +0200| [63c1fd74f7eb188318c89758fdabdfd4c43e9968] | committer: Rémi Duraffort
Check malloc return value.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=63c1fd74f7eb188318c89758fdabdfd4c43e9968
---
modules/access/dvb/linux_dvb.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/modules/access/dvb/linux_dvb.c b/modules/access/dvb/linux_dvb.c
index f72eeac..c282b5e 100644
--- a/modules/access/dvb/linux_dvb.c
+++ b/modules/access/dvb/linux_dvb.c
@@ -110,6 +110,8 @@ int FrontendOpen( access_t *p_access )
}
p_sys->p_frontend = p_frontend = malloc( sizeof(frontend_t) );
+ if( !p_frontend )
+ return VLC_ENOMEM;
msg_Dbg( p_access, "Opening device %s", frontend );
if( (p_sys->i_frontend_handle = open(frontend, O_RDWR | O_NONBLOCK)) < 0 )
@@ -1508,7 +1510,8 @@ int CAMOpen( access_t *p_access )
{
p_sys->i_ca_type = CA_CI;
}
- else {
+ else
+ {
p_sys->i_ca_type = -1;
msg_Err( p_access, "CAMInit: incompatible CAM interface" );
close( p_sys->i_ca_handle );
More information about the vlc-devel
mailing list