Fixed #5582 (Crash when there is OOM)

This commit is contained in:
Daniel Marjamäki 2016-05-28 13:24:19 +02:00
parent 2b2f12bcd5
commit 18fc288de9
1 changed files with 2 additions and 0 deletions

View File

@ -298,6 +298,8 @@ unsigned int CppCheck::processFile(const std::string& filename, std::istream& fi
} catch (const std::runtime_error &e) { } catch (const std::runtime_error &e) {
internalError(filename, e.what()); internalError(filename, e.what());
} catch (const std::bad_alloc &e) {
internalError(filename, e.what());
} catch (const InternalError &e) { } catch (const InternalError &e) {
internalError(filename, e.errorMessage); internalError(filename, e.errorMessage);
exitcode=1; // e.g. reflect a syntax error exitcode=1; // e.g. reflect a syntax error