[omniORB] Bug in String_member::operator<<=()

Artem Mironov art@lincom.kharkov.ua
Wed, 2 Feb 2000 03:24:43 +0200


Hi omniORBers,

There is a bug in _CORBA_String_member::operator<<=();
The new version of String_member default contructor initialises the
String_member::pd_data to static allocated empty string. In this 
case we should not release it.


===================================================================
RCS file: /cvsroot/omni/src/lib/omniORB2/orbcore/corbaString.cc,v
retrieving revision 1.14
diff -u -r1.14 corbaString.cc
--- corbaString.cc	1999/06/18 20:52:29	1.14
+++ corbaString.cc	2000/02/02 01:02:20
@@ -144,7 +144,8 @@
 _CORBA_String_member::operator <<= (NetBufferedStream& s)
 {
   if( _ptr ) {
-    FREE_BYTES(_ptr);
+    if(pd_rel)
+        FREE_BYTES(_ptr);
     _ptr = 0;
   }
 
@@ -195,7 +196,8 @@
 _CORBA_String_member::operator <<= (MemBufferedStream& s)
 {
   if( _ptr ) {
-    FREE_BYTES(_ptr);
+    if(pd_rel)
+        FREE_BYTES(_ptr);
     _ptr = 0;
   }

-- 
Best Regards
Artem