This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: valgrind -vs- jcf-dump
- From: Tom Tromey <tromey at redhat dot com>
- To: GCJ-patches <java-patches at gcc dot gnu dot org>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: 06 Apr 2007 08:11:28 -0600
- Subject: Patch: FYI: valgrind -vs- jcf-dump
- Reply-to: tromey at redhat dot com
I'm checking this in.
Colin Walters noticed that 'valgrind jcf-dump some.jar' shows that
jcf-dump is free()ing something that was not allocated. This patch
fixes the problem.
Tom
Index: ChangeLog
from Colin Walters <walters@redhat.com>
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=161701
* jcf-io.c (open_class): Copy 'filename'.
Index: jcf-io.c
===================================================================
--- jcf-io.c (revision 123217)
+++ jcf-io.c (working copy)
@@ -259,7 +259,7 @@
jcf->read_ptr = jcf->buffer;
jcf->read_end = jcf->buffer_end;
jcf->read_state = NULL;
- jcf->filename = filename;
+ jcf->filename = xstrdup (filename);
if (read (fd, jcf->buffer, stat_buf.st_size) != stat_buf.st_size)
{
perror ("Failed to read .class file");