On Tue, 21 Dec 2004, Timothy Stack wrote:

> > >
> > > I think the removal of these two KFREE calls will leak memory, won't it?
> >
> > hand.base is const.  It should never have been freed in the first place.
>
> Eh?  The "const" means the contents of the array aren't going to change,
> not that it points to static memory.  From findInJar.c:
>
>                       data = NULL;
>                       if (sbuf.st_size > 0)
>                       {
> alloc  >>                     data = KMALLOC((size_t)sbuf.st_size);
>                               if (data == 0) {
>                                       postOutOfMemory(einfo);
>                                       goto done;
>                               }
>                       }
>
>                       [...]
>
>                       classFileInit(hand, data, (unsigned)sbuf.st_size, 
> CP_DIR);
>
> The classFileInit then transfers the memory to the classFile object.

But you also can't free static memory.

And yes, that was being attempted.


_______________________________________________
kaffe mailing list
kaffe@kaffe.org
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe

Reply via email to