Commit a5abc980 by Andrew Pinski Committed by Andrew Pinski

re PR java/30454 (empty "zip" file in class path can cause leakage of file streams)

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.

From-SVN: r121101
parent fc376903
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.
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment