[kaffe] CVS kaffe (doogie): Various gcc and sparse fixes all over the board.

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


On Tue, 21 Dec 2004, Helmer [ISO-8859-15] Krämer wrote:

> On Tue, 21 Dec 2004 00:11:20 -0800
> Kaffe CVS <cvs-commits at kaffe.org> wrote:
>
> Hi,
>
> > @@ -66,7 +66,7 @@
> >
> >  #if defined(HANDLE_MANIFEST_CLASSPATH)
> >  static int isEntryInClasspath(const char*);
> > -static uint8* getManifestMainAttribute(jarFile*, char*);
> > +static uint8* getManifestMainAttribute(jarFile*, const char*);
> >  static void handleManifestClassPath (classpathEntry *);
> >  #endif
> >
> > @@ -134,9 +134,8 @@
> >  	case CP_DIR:
> >  	case CP_ZIPFILE:
> >  		class = newClass();
> > -		if (class == 0) {
> > +		if (class == NULL) {
> >  			postOutOfMemory(einfo);
> > -			KFREE(hand.base);
> >  			return (NULL);
> >  		}
> >
> > @@ -144,14 +143,13 @@
> >  		class->centry = centry;
> >  		class = readClass(class, &hand, NULL, einfo);
> >
> > -		if (hand.base != 0) {
> > +		if (hand.base != NULL) {
> >  #if defined(KAFFE_STATS)
> >  			if (hand.type == CP_ZIPFILE) {
> >  				addToCounter(&jarmem, "vmmem-jar files", 1,
> >  					-(jlong)GCSIZEOF(hand.base));
> >  			}
> >  #endif
> > -			KFREE(hand.base);
> >  		}
> >  		return (class);
>
> 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.




More information about the kaffe mailing list