uemis: close reqtxt file in error case

Found by Coverity. Should switch to C++ "RAII" type, but no
priority for now.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-08-13 23:15:32 +02:00 committed by Michael Keller
parent 2bbc95e8f1
commit 6d08903917

View file

@ -515,6 +515,7 @@ static std::string uemis_get_answer(const std::string &path, const std::string &
int written = write(reqtxt_file, sb.c_str(), sb.size()); int written = write(reqtxt_file, sb.c_str(), sb.size());
if (written == -1 || (size_t)written != sb.size()) { if (written == -1 || (size_t)written != sb.size()) {
error_text = translate("gettextFromC", ERR_FS_SHORT_WRITE); error_text = translate("gettextFromC", ERR_FS_SHORT_WRITE);
close(reqtxt_file);
return std::string(); return std::string();
} }
if (!next_file(number_of_files)) { if (!next_file(number_of_files)) {