diff options
author | jstebbins <[email protected]> | 2009-07-24 20:39:22 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2009-07-24 20:39:22 +0000 |
commit | a8510d9d290754ed2187cbf122dbeda5dae887bb (patch) | |
tree | 5f57af79d3366d63365f30ddc6a20368632a33b1 /libhb | |
parent | db56dba1aa71d52eb6f1b1c2d1d3ad2c11b47df7 (diff) |
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
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/ports.c | 7 |
1 files changed, 7 insertions, 0 deletions
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; |