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

Timothy Stack stack at cs.utah.edu
Tue Dec 21 10:35:01 PST 2004


> >
> > 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.

tim




More information about the kaffe mailing list