In OLE Automation when IDispatch::Invoke returns DISP_E_EXCEPTION the OLE object fills out an EXCEPINFO structure. Some fields in that structure are allocated BSTRs that it is the responsibility of the client (ooRexx in this case) to release.
In the current code, the BSTRs are only released when the OLE object provides a deferred fill-in function. This is incorrect, they always need to be released. Whether the OLE object allocates them immediately or defers their allocation, the net effect is the same. They are allocated by the OLE object and need to be released by the client.