aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/java/ChangeLog6
-rw-r--r--gcc/java/jcf-io.c12
2 files changed, 16 insertions, 2 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index b26cba7..3702984 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,9 @@
+2007-01-23 Andrew Pinski <pinskia@gmail.com>
+
+ 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 <tromey@redhat.com>
* java-tree.def: Added copyright header.
diff --git a/gcc/java/jcf-io.c b/gcc/java/jcf-io.c
index 27b9103..0c9b07b 100644
--- a/gcc/java/jcf-io.c
+++ b/gcc/java/jcf-io.c
@@ -134,10 +134,18 @@ opendir_in_zip (const char *zipfile, int is_system)
{
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;