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 7b4714d..cc024a1 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 <stdio.h>
-#ifndef _WIN32
#include <inttypes.h>
-#else
-#include <stdint.h>
-#endif
#include <limits.h>
#include "main.h"
#include "globals.h"
diff --git a/lib/cpp/src/transport/TFileTransport.cpp b/lib/cpp/src/transport/TFileTransport.cpp
index 3121b43..47dc328 100644
--- a/lib/cpp/src/transport/TFileTransport.cpp
+++ b/lib/cpp/src/transport/TFileTransport.cpp
@@ -250,6 +250,7 @@
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 d12e384..767e563 100644
--- a/lib/cpp/test/TransportTest.cpp
+++ b/lib/cpp/test/TransportTest.cpp
@@ -127,6 +127,7 @@
template <class Transport_>
class CoupledTransports {
public:
+ virtual ~CoupledTransports() {}
typedef Transport_ TransportType;
CoupledTransports() : in(), out() {}