From a8510d9d290754ed2187cbf122dbeda5dae887bb Mon Sep 17 00:00:00 2001 From: jstebbins Date: Fri, 24 Jul 2009 20:39:22 +0000 Subject: libhb: close file handle after querying dvd region mask from drive this only affected linux since we only query the region mask on linux git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2729 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/ports.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libhb') diff --git a/libhb/ports.c b/libhb/ports.c index 7b18ce896..6368bcba4 100644 --- a/libhb/ports.c +++ b/libhb/ports.c @@ -103,12 +103,19 @@ int hb_dvd_region(char *device, int *region_mask) if ( fd < 0 ) return -1; if ( fstat( fd, &st ) < 0 ) + { + close( fd ); return -1; + } if ( !( S_ISBLK( st.st_mode ) || S_ISCHR( st.st_mode ) ) ) + { + close( fd ); return -1; + } ai.type = DVD_LU_SEND_RPC_STATE; ret = ioctl(fd, DVD_AUTH, &ai); + close( fd ); if ( ret < 0 ) return ret; -- cgit v1.2.3