[svn] commit: r702 - /branches/parkinglot/src/lib/cc/cpp/data.cc

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Feb 2 15:46:08 UTC 2010


Author: jelte
Date: Tue Feb  2 15:46:08 2010
New Revision: 702

Log:
fixed the warnings/errors from cppcheck

Modified:
    branches/parkinglot/src/lib/cc/cpp/data.cc

Modified: branches/parkinglot/src/lib/cc/cpp/data.cc
==============================================================================
--- branches/parkinglot/src/lib/cc/cpp/data.cc (original)
+++ branches/parkinglot/src/lib/cc/cpp/data.cc Tue Feb  2 15:46:08 2010
@@ -43,7 +43,7 @@
 const unsigned char ITEM_LENGTH_MASK = 0x30;
 
 static inline void
-throwParseError(const std::string error, const std::string file, int line = 0, int pos = 0)
+throwParseError(const std::string& error, const std::string& file, int line = 0, int pos = 0)
 {
     if (line != 0 || pos != 0) {
         std::stringstream ss;
@@ -574,6 +574,7 @@
 
     in.read(buf, item_length);
     if (in.fail()) {
+        delete[] buf;
         throw DecodeError();
     }
     buf[item_length] = 0;
@@ -593,6 +594,7 @@
 
     in.read(buf, item_length);
     if (in.fail()) {
+        delete[] buf;
         throw DecodeError();
     }
     buf[item_length] = 0;




More information about the bind10-changes mailing list