[omniORB] Freeing mismatched memory.

Gary D. Duzan gdd0@gte.com
Wed, 03 Feb 1999 15:09:37 -0500


   Try using CORBA::string_alloc() instead of new char[]. I think you
have to do it that way because of the way Windows does memory
management and libraries.

					Gary Duzan
					GTE Laboratories



In Message <36B89BC3.6DE35F9A@anite-systems.lu> ,
   Henrik Schulz <henrik.schulz@anite-systems.lu> wrote:

=>Hi ,
=>perhaps someone who knows much better the ORB libs than me, might have
=>an idea about the following.
=>Assumed the interface
=>
=>CORBA::UShort A::member(const char *name,char* &firstname)
=>  {
=> char *xyz;
=>  ....
=>
=>  if(!(firstname = new char[strlen(xyz)+1]))
=>    Warning ....
=>  strcpy(firstname,xyz);
=>
=> return 0;
=> }
=>
=>After having processed the member-function, the reference arg
=>"firstname" is processed within the omniORB libs for transmission,
=>somewhere within this processing Rational's Purify creates the following
=>message during RT, which looks frightening:
=>
=>[E] FMM: Freeing mismatched memory in CORBA::string_free(char *) {1
=>occurrence}
=>    Address 0x03cb0030 points into a HeapAlloc'd block in heap
=>0x03230000
=>    Location of free attempt
=>        CORBA::string_free(char *)+0xa
=>[E:\apps\omniORB\bin\x86win32\omniORB260_rt.dll ip=0x10007e4a]
=>
=>It seems the memory of the arg "firstname" is freed by one of the CORBA
=>objects own functions, but I don't know , what happens in between. we
=>are using omniORB 2.6.1
=>
=>Any help are welcome, thanx in advance.
=>
=>
=>Henrik.
=>
=>
=>--
=>Henrik Schulz
=>Anite-Systems
=>mailto:Henrik.Schulz@Anite-Systems.lu
=>
=>
=>