You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by gw...@apache.org on 2007/02/20 14:13:08 UTC

svn commit: r509544 - in /incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo: CopyHelper.cpp SDORuntimeException.cpp SDOValue.cpp

Author: gwinn
Date: Tue Feb 20 05:13:07 2007
New Revision: 509544

URL: http://svn.apache.org/viewvc?view=rev&rev=509544
Log:
Fixes identified by valgrind.

Modified:
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/CopyHelper.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDORuntimeException.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOValue.cpp

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/CopyHelper.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/CopyHelper.cpp?view=diff&rev=509544&r1=509543&r2=509544
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/CopyHelper.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/CopyHelper.cpp Tue Feb 20 05:13:07 2007
@@ -84,7 +84,7 @@
                     wchar_t * buf = new wchar_t[siz];
                     from->getString(p,buf, siz);
                     to->setString(p, buf, siz);
-                    delete buf;
+                    delete[] buf;
                 }
             }
             break;

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDORuntimeException.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDORuntimeException.cpp?view=diff&rev=509544&r1=509543&r2=509544
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDORuntimeException.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDORuntimeException.cpp Tue Feb 20 05:13:07 2007
@@ -79,14 +79,26 @@
 // ========================================================================
 SDORuntimeException :: ~SDORuntimeException()
 {
-    if (class_name) delete class_name;
-    if (message_text) delete message_text;
-    for (int i=0;i<location_set;i++)
-    {
-        if (locations[i].file) delete locations[i].file;
-        if (locations[i].function) delete locations[i].function;
-    }
-
+   if (class_name)
+   {
+      delete[] class_name;
+   }
+   if (message_text)
+   {
+      delete[] message_text;
+   }
+   
+   for (int i = 0; i < location_set; i++)
+   {
+      if (locations[i].file)
+      {
+         delete[] locations[i].file;
+         if (locations[i].function)
+         {
+            delete[] locations[i].function;
+         }
+      }
+   }
 } // end SDORuntimeException destructor
                     
 // ========================================================================

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOValue.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOValue.cpp?view=diff&rev=509544&r1=509543&r2=509544
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOValue.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOValue.cpp Tue Feb 20 05:13:07 2007
@@ -126,7 +126,7 @@
                  value.TextString = 0;
                  break;
               case DataTypeInfo::SDOWideString:
-                 delete value.WideString.data;
+                 delete[] value.WideString.data;
                  value.WideString.data = 0;
                  value.WideString.length = 0;
                  break;
@@ -210,7 +210,7 @@
               value.TextString = 0;
               break;
            case DataTypeInfo::SDOWideString:
-              delete value.WideString.data;
+              delete[] value.WideString.data;
               value.WideString.data = 0;
               value.WideString.length = 0;
               break;



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org