[kaffe] CVS kaffe (doogie): Various gcc and sparse fixes all

Adam Heath doogie at brainfood.com
Tue Dec 21 10:50:29 PST 2004


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.




More information about the kaffe mailing list