THRIFT-926. cpp: Thrift: throw bad_alloc when malloc fails, not something else
authorDavid Reiss <dreiss@apache.org>
Wed, 6 Oct 2010 17:10:49 +0000 (17:10 +0000)
committerDavid Reiss <dreiss@apache.org>
Wed, 6 Oct 2010 17:10:49 +0000 (17:10 +0000)
commitf673509f1be499bc899e204ab0d7837ebf4f418a
treebd3b0300c69f6043d939c40682db6a2412b41553
parent2991a0f376ab7640b7259ac8db0af820054998cd
THRIFT-926. cpp: Thrift: throw bad_alloc when malloc fails, not something else

When malloc/realloc fail, we've typically just thrown a TException. This
allows a server that should simply crash when out of memory to survive
in a strage state, with various bad consequences. Instead, we should
throw bad_alloc and just not catch it (or if we decide to, be very
careful to respond properly).

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005167 13f79535-47bb-0310-9956-ffa450edef68
lib/cpp/src/protocol/TBinaryProtocol.tcc
lib/cpp/src/protocol/TCompactProtocol.tcc
lib/cpp/src/transport/TBufferTransports.cpp
lib/cpp/src/transport/TBufferTransports.h
lib/cpp/src/transport/TFileTransport.cpp
lib/cpp/src/transport/THttpTransport.cpp
lib/cpp/src/transport/TTransportUtils.h