tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gw...@apache.org
Subject svn commit: r509659 - in /incubator/tuscany/cpp/sdo/runtime/core: src/commonj/sdo/ test/
Date Tue, 20 Feb 2007 17:09:01 GMT
Author: gwinn
Date: Tue Feb 20 09:08:59 2007
New Revision: 509659

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

Modified:
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummaryImpl.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/PropertyImpl.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSAX2Parser.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLString.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Setting.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeImpl.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/XMLHelperImpl.cpp
    incubator/tuscany/cpp/sdo/runtime/core/test/sdotest.cpp

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummaryImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummaryImpl.cpp?view=diff&rev=509659&r1=509658&r2=509659
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummaryImpl.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummaryImpl.cpp Tue Feb 20
09:08:59 2007
@@ -1551,7 +1551,7 @@
         if (theSequence) delete theSequence;
         if (theOldXpath != 0) 
         {
-            delete theOldXpath;
+            delete[] theOldXpath;
         }
     }
 

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/PropertyImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/PropertyImpl.cpp?view=diff&rev=509659&r1=509658&r2=509659
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/PropertyImpl.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/PropertyImpl.cpp Tue Feb 20 09:08:59
2007
@@ -154,11 +154,17 @@
           }
       }
 
-    PropertyImpl::~PropertyImpl()
-    {
-        if (defvalue != 0) delete (char*)defvalue;
-        if (stringdef != 0) delete stringdef;
-    }
+       PropertyImpl::~PropertyImpl()
+       {
+          if (defvalue != 0)
+          {
+             delete[] defvalue;
+          }
+          if (stringdef != 0)
+          {
+             delete[] stringdef;
+          }
+       }
 
     ///////////////////////////////////////////////////////////////////////////
     // Setting of attributes  by DAS 

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSAX2Parser.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSAX2Parser.cpp?view=diff&rev=509659&r1=509658&r2=509659
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSAX2Parser.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSAX2Parser.cpp Tue Feb 20 09:08:59
2007
@@ -1050,7 +1050,7 @@
                             sprintf(msg,"Parser found unknown element %s",
                             (const char*)localname);
                             setter->setError( msg );
-                            delete msg;
+                            delete[] msg;
                         }
                     }
                     LOGEXIT(INFO,"SDOSAX2Parser: startElementNs - exit7");

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLString.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLString.cpp?view=diff&rev=509659&r1=509658&r2=509659
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLString.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLString.cpp Tue Feb 20 09:08:59
2007
@@ -179,7 +179,7 @@
                 newString[i] = tolower(newString[i]);
             }
             SDOXMLString retString(newString);
-            delete newString;
+            delete[] newString;
             return retString;
         }
 

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Setting.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Setting.cpp?view=diff&rev=509659&r1=509658&r2=509659
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Setting.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Setting.cpp Tue Feb 20 09:08:59
2007
@@ -140,10 +140,10 @@
             case Type::BigIntegerType: 
             case Type::StringType: 
             case Type::UriType:
-                delete (wchar_t*)value;
+                delete[] (wchar_t*) value;
                 break;
             case Type::BytesType:
-                delete (char*)value;
+                delete[] (char*) value;
                 break;
             case Type::OtherTypes:
             case Type::DataObjectType:
@@ -151,7 +151,10 @@
             default:
                 break;
         }
-        if (strbuf != 0) delete strbuf;
+        if (strbuf != 0)
+        {
+           delete[] strbuf;
+        }
     }
 
     const Property& Setting::getProperty() const

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeImpl.cpp?view=diff&rev=509659&r1=509658&r2=509659
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeImpl.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeImpl.cpp Tue Feb 20 09:08:59
2007
@@ -218,7 +218,7 @@
          }
          for (unsigned int j = 0; j < aliases.size();j++)
          {
-             delete aliases[j];
+             delete[] aliases[j];
          }
     }
 

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/XMLHelperImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/XMLHelperImpl.cpp?view=diff&rev=509659&r1=509658&r2=509659
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/XMLHelperImpl.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/XMLHelperImpl.cpp Tue Feb 20 09:08:59
2007
@@ -478,7 +478,7 @@
             {
                 if (*parseErrors.begin() != 0)
                 {
-                    delete (char*)(*parseErrors.begin());
+                    delete[] (char*)(*parseErrors.begin());
                 }
                 parseErrors.erase(parseErrors.begin());
             }

Modified: incubator/tuscany/cpp/sdo/runtime/core/test/sdotest.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/test/sdotest.cpp?view=diff&rev=509659&r1=509658&r2=509659
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/test/sdotest.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/test/sdotest.cpp Tue Feb 20 09:08:59 2007
@@ -1841,7 +1841,7 @@
             fprintf(f, "%c",buf[i]);
         }
         fprintf(f, "\n");
-        delete buf;
+        delete[] buf;
         const char* wws = pstring.getCStringDefault();
         fprintf(f, "String default as a string is %s\n", wws);
 
@@ -1862,7 +1862,7 @@
             fprintf(f, "%c", buf[i]);
         }
         fprintf(f, "\n");
-        delete buf;
+        delete[] buf;
     }
     else
     {
@@ -1938,7 +1938,7 @@
 
     mdg->setDefault("myspace","DefaultTest","string", help, 4);
 
-    delete help;
+    delete[] help;
 
     char* help2 = new char[4];
     help2[0] = 'H';
@@ -1949,7 +1949,7 @@
 
     mdg->setDefault("myspace","DefaultTest","bytes", help2, 4);
 
-    delete help2;
+    delete[] help2;
 
     // and have another go at getting them....
 



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


Mime
View raw message