TRACEME(("new class name \"%s\" will bear ID = %d", classname, cxt->classnum));
- if (!av_store(cxt->aclass, cxt->classnum++, newSVpvn(classname, len)))
+ if (!av_store(cxt->aclass, cxt->classnum++, newSVpvn(classname, len))) {
+ if (classname != buf)
+ Safefree(classname);
return (SV *) 0;
+ }
/*
* Retrieve object and bless it.
* Record new classname.
*/
- if (!av_store(cxt->aclass, cxt->classnum++, newSVpvn(classname, len)))
+ if (!av_store(cxt->aclass, cxt->classnum++, newSVpvn(classname, len))) {
+ if (classname != buf)
+ Safefree(classname);
return (SV *) 0;
+ }
}
TRACEME(("class name: %s", classname));