[MPlayer-cvslog] CVS: main/osdep scandir.c,1.1,1.2
Aurelien Jacobs CVS
syncmail at mplayerhq.hu
Sat Jul 23 00:52:16 CEST 2005
CVS change done by Aurelien Jacobs CVS
Update of /cvsroot/mplayer/main/osdep
In directory mail:/var2/tmp/cvs-serv8527/osdep
Modified Files:
scandir.c
Log Message:
add some closedir() to fix some opendir() leaks
Index: scandir.c
===================================================================
RCS file: /cvsroot/mplayer/main/osdep/scandir.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- scandir.c 26 Nov 2002 18:31:30 -0000 1.1
+++ scandir.c 22 Jul 2005 22:52:13 -0000 1.2
@@ -87,7 +87,7 @@
/* duplicate struct direct for this entry */
len = offsetof(struct dirent, d_name) + strlen(ent->d_name) + 1;
if ((ent2 = malloc(len)) == NULL)
- return -1;
+ goto error;
if (used >= allocated) {
allocated *= 2;
@@ -109,6 +109,8 @@
error:
+ closedir(dir);
+
if (namelist) {
for (i = 0; i < used; i++)
free(namelist[i]);
More information about the MPlayer-cvslog
mailing list