[omniORB] Memory leak in corbaString.cc

姜 维 sdjiangwei at live.cn
Fri Jan 27 07:02:14 UTC 2023


Index: src/lib/omniORB/orbcore/corbaString.cc
===================================================================
--- src/lib/omniORB/orbcore/corbaString.cc      (版本 6632)
+++ src/lib/omniORB/orbcore/corbaString.cc      (工作副本)
@@ -80,14 +80,14 @@
     OMNIORB_THROW(MARSHAL, MARSHAL_PassEndOfMessage,
                  (CORBA::CompletionStatus)completion());

-  char* s = _CORBA_String_helper::alloc(len - 1);
-  get_octet_array((_CORBA_Octet*)s, len);
+  _CORBA_String_var s = _CORBA_String_helper::alloc(len - 1);
+  get_octet_array((_CORBA_Octet*)s.inout(), len);

   if (s[len-1] != '\0')
     OMNIORB_THROW(MARSHAL,MARSHAL_StringNotEndWithNull,
                  (CORBA::CompletionStatus)completion());

-  return s;
+  return s._retn();
}

#ifndef Swap32

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.omniorb-support.com/pipermail/omniorb-list/attachments/20230127/1af830ed/attachment.html>


More information about the omniORB-list mailing list