changeset 283:d0b684fc4b1f src

avoid leaking file descriptors obtained by opendir(); synced with upstream as reported by Diego Petteno'
author nicodvb
date Wed, 18 Apr 2007 22:41:10 +0000
parents 918fe20358cb
children a5f395f352c9
files dvdread/dvd_reader.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dvdread/dvd_reader.c	Wed Apr 18 22:36:58 2007 +0000
+++ b/dvdread/dvd_reader.c	Wed Apr 18 22:41:10 2007 +0000
@@ -586,10 +586,12 @@
             sprintf( filename, "%s%s%s", path,
                      ( ( path[ strlen( path ) - 1 ] == '/' ) ? "" : "/" ),
                      ent->d_name );
+            closedir( dir );
             return 0;
         }
     }
 
+    closedir( dir );
     return -1;
 }