From 11917b03d8af4f27150aeab9a211e608b4f39cc7 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Fri, 1 Apr 2022 12:26:00 +0200 Subject: [PATCH] Coverity: 1466057 Unchecked return value --- pdns/misc.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pdns/misc.cc b/pdns/misc.cc index ac5f74888b..92318063f6 100644 --- a/pdns/misc.cc +++ b/pdns/misc.cc @@ -826,12 +826,10 @@ bool readFileIfThere(const char* fname, std::string* line) { line->clear(); auto fp = std::unique_ptr(fopen(fname, "r"), fclose); - if(!fp) + if (!fp) { return false; - stringfgets(fp.get(), *line); - fp.reset(); - - return true; + } + return stringfgets(fp.get(), *line); } Regex::Regex(const string &expr) -- 2.47.2