lightspark/lightspark — comment on commit 7b064c2377c55b83a3a53e014799a852161ba023
File:  line 0
By aajanki:

Isn't there a memory leak in GetStringFromObject()? getInstanceS() in GetStringFromObject() creates a new object which is not decReffed anywhere.

Maybe GetStringFromObject() could be replaced by obj->toString() because many methods will only access th->data. This would also fix the leak. Otherwise you should do obj->incRef() in the (obj->getObjectType() == T_STRING) branch and the caller should decRef the return value (or return _MR so that decRef happens automatically).