[DVDnav-discuss] r923 - trunk/libdvdnav2/src/dvdread/dvd_reader.c

nicodvb subversion at mplayerhq.hu
Sun Apr 29 13:47:39 CEST 2007


Author: nicodvb
Date: Sun Apr 29 13:47:39 2007
New Revision: 923

Log:
avoid leaking file descriptors obtained by opendir(); synced with upstream as reported by Diego Petteno'

Modified:
   trunk/libdvdnav2/src/dvdread/dvd_reader.c

Modified: trunk/libdvdnav2/src/dvdread/dvd_reader.c
==============================================================================
--- trunk/libdvdnav2/src/dvdread/dvd_reader.c	(original)
+++ trunk/libdvdnav2/src/dvdread/dvd_reader.c	Sun Apr 29 13:47:39 2007
@@ -586,10 +586,12 @@ static int findDirFile( const char *path
             sprintf( filename, "%s%s%s", path,
                      ( ( path[ strlen( path ) - 1 ] == '/' ) ? "" : "/" ),
                      ent->d_name );
+            closedir( dir );
             return 0;
         }
     }
 
+    closedir( dir );
     return -1;
 }
 



More information about the DVDnav-discuss mailing list