[omniORB] Patch: Memory leak when unmarshalling a _nil object reference

Randy Shoup rshoup@tumbleweed.com
Tue, 15 Dec 1998 11:21:00 -0800


All -- 

  In Purify'ing our code, we have discovered a memory leak in omniORB
2.6.1.  It occurs when unmarshalling a _nil object reference returned
from a CORBA call, and leaks 1 byte per call.  

  Below is a patch to objectRef.cc that fixes the leak:

*** merge/objectRef.cc	Fri Dec  4 03:58:30 1998
--- objectRef.cc	Tue Dec 15 10:31:47 1998
***************
*** 681,686 ****
--- 681,688 ----
        // This is a nil object reference
        delete profiles;
        profiles = 0;
+       delete [] id;
+       id = 0;
        return CORBA::Object::_nil();
      }
      else {
***************
*** 813,818 ****
--- 815,822 ----
        // This is a nil object reference
        delete profiles;
        profiles = 0;
+       delete [] id;
+       id = 0;
        return CORBA::Object::_nil();
      }
      else {


-- Randy
_________________________________________________________________  
Randy Shoup                                     (650)569-3682  
Principal Engineer                              rshoup@tumbleweed.com  
Tumbleweed Software Corporation