From: Roger Meier Date: Sun, 6 Nov 2011 12:04:28 +0000 (+0000) Subject: THRIFT-1361 revert compiler/cpp/src/thrifty.yy change X-Git-Tag: 0.8.0~27 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=6f7681f91d1cdf41be657978d819d94b6024c434;p=common%2Fthrift.git THRIFT-1361 revert compiler/cpp/src/thrifty.yy change => breaks mingw build => memleak fixes reported by cppcheck git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1198347 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/compiler/cpp/src/thrifty.yy b/compiler/cpp/src/thrifty.yy index 7b4714d9..cc024a1a 100644 --- a/compiler/cpp/src/thrifty.yy +++ b/compiler/cpp/src/thrifty.yy @@ -28,11 +28,7 @@ #define __STDC_LIMIT_MACROS #define __STDC_FORMAT_MACROS #include -#ifndef _WIN32 #include -#else -#include -#endif #include #include "main.h" #include "globals.h" diff --git a/lib/cpp/src/transport/TFileTransport.cpp b/lib/cpp/src/transport/TFileTransport.cpp index 3121b438..47dc3281 100644 --- a/lib/cpp/src/transport/TFileTransport.cpp +++ b/lib/cpp/src/transport/TFileTransport.cpp @@ -250,6 +250,7 @@ void TFileTransport::enqueueEvent(const uint8_t* buf, uint32_t eventLen) { eventInfo* toEnqueue = new eventInfo(); toEnqueue->eventBuff_ = (uint8_t *)std::malloc((sizeof(uint8_t) * eventLen) + 4); if (toEnqueue->eventBuff_ == NULL) { + delete toEnqueue; throw std::bad_alloc(); } // first 4 bytes is the event length diff --git a/lib/cpp/test/TransportTest.cpp b/lib/cpp/test/TransportTest.cpp index d12e384d..767e5632 100644 --- a/lib/cpp/test/TransportTest.cpp +++ b/lib/cpp/test/TransportTest.cpp @@ -127,6 +127,7 @@ class GenericSizeGenerator : public SizeGenerator { template class CoupledTransports { public: + virtual ~CoupledTransports() {} typedef Transport_ TransportType; CoupledTransports() : in(), out() {}