From fcd72581a169875c17c8b699f260e321af388fb5 Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 14 Jun 2021 12:10:47 +0100 Subject: [PATCH] Make out-of-memory in computeHash fatal --- simgear/io/sg_file.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/simgear/io/sg_file.cxx b/simgear/io/sg_file.cxx index 1747e971..2cfb9e43 100644 --- a/simgear/io/sg_file.cxx +++ b/simgear/io/sg_file.cxx @@ -82,9 +82,7 @@ std::string SGFile::computeHash() [](char* p) { free(p); }}; if (!buf) { - // @TODO report out of memory error - SG_LOG(SG_IO, SG_ALERT, "Failed to malloc buffer for SHA1 check:" << file_name); - return {}; + throw sg_exception("Malloc of SHA buffer failed", {}, file_name); } size_t readLen;