Index: java/ChangeLog =================================================================== --- java/ChangeLog (revision 121100) +++ java/ChangeLog (working copy) @@ -1,3 +1,9 @@ +2007-01-23 Andrew Pinski + + PR java/30454 + * jcf-io.c (opendir_in_zip): Close the file + and free zipf before returning after an error. + 2007-01-16 Tom Tromey * java-tree.def: Added copyright header. Index: java/jcf-io.c =================================================================== --- java/jcf-io.c (revision 121081) +++ java/jcf-io.c (working copy) @@ -134,10 +134,18 @@ opendir_in_zip (const char *zipfile, int { jcf_dependency_add_file (zipfile, is_system); if (read (fd, magic, 4) != 4 || GET_u4 (magic) != (JCF_u4)ZIPMAGIC) - return NULL; + { + free (zipf); + close (fd); + return NULL; + } lseek (fd, 0L, SEEK_SET); if (read_zip_archive (zipf) != 0) - return NULL; + { + free (zipf); + close (fd); + return NULL; + } } SeenZipFiles = zipf;