diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 1c72c0c7b..97f0b3d5b 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -298,6 +298,8 @@ unsigned int CppCheck::processFile(const std::string& filename, std::istream& fi } catch (const std::runtime_error &e) { internalError(filename, e.what()); + } catch (const std::bad_alloc &e) { + internalError(filename, e.what()); } catch (const InternalError &e) { internalError(filename, e.errorMessage); exitcode=1; // e.g. reflect a syntax error