summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTomas Chvatal <tchvatal@suse.cz>2012-08-11 11:04:58 +0200
committerTomas Chvatal <tchvatal@suse.cz>2012-08-11 11:04:58 +0200
commit4942ae2fac693e35072d27564286d6852f964dab (patch)
tree1e4cf7039c4b3a5bb6adbc4bf72affcca20064ee /src
parente349cf4c312afbeeb388327848a4f3c0378be534 (diff)
parentec8f67b0bf103b553f435d3b969965f9cff58768 (diff)
downloadcppunit-feature/buildsystem_rewrite.tar.gz
Merge branch 'master' into feature/buildsystem_rewritefeature/buildsystem_rewrite
Conflicts: config/ax_cxx_gcc_abi_demangle.m4
Diffstat (limited to 'src')
-rw-r--r--src/cppunit/TypeInfoHelper.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/cppunit/TypeInfoHelper.cpp b/src/cppunit/TypeInfoHelper.cpp
index ff1d662..2df5786 100644
--- a/src/cppunit/TypeInfoHelper.cpp
+++ b/src/cppunit/TypeInfoHelper.cpp
@@ -6,7 +6,7 @@
#include <string>
#if CPPUNIT_HAVE_GCC_ABI_DEMANGLE
-#include <malloc.h>
+#include <cstdlib>
#include <cxxabi.h>
#endif
@@ -24,8 +24,16 @@ TypeInfoHelper::getClassName( const std::type_info &info )
c_name = abi::__cxa_demangle( info.name(), 0, 0, &status );
- std::string name( c_name );
- free( c_name );
+ std::string name;
+ if(c_name)
+ {
+ name = std::string( c_name );
+ free( c_name );
+ }
+ else
+ {
+ name = std::string( info.name() );
+ }
#else // CPPUNIT_HAVE_GCC_ABI_DEMANGLE