Revision: 14255
Author: adrian.chadd
Date: Sat Aug  1 22:56:29 2009
Log: Don't leak a filedescriptor if the fstat() fails.


http://code.google.com/p/lusca-cache/source/detail?r=14255

Modified:
  /branches/LUSCA_HEAD/app/ufs_rebuild/ufs_build_dir.c

=======================================
--- /branches/LUSCA_HEAD/app/ufs_rebuild/ufs_build_dir.c        Fri Jul 24  
20:20:55 2009
+++ /branches/LUSCA_HEAD/app/ufs_rebuild/ufs_build_dir.c        Sat Aug  1  
22:56:29 2009
@@ -71,6 +71,7 @@

        /* We need the entire file size */
        if (fstat(fd, &sb) < 0) {
+               close(fd);
                perror("fstat");
                return 0;
        }

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"lusca-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/lusca-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to