From: Otto Moerbeek Date: Fri, 1 Apr 2022 10:26:00 +0000 (+0200) Subject: Coverity: 1466057 Unchecked return value X-Git-Tag: rec-4.7.0-beta1~22^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=11917b03d8af4f27150aeab9a211e608b4f39cc7;p=thirdparty%2Fpdns.git Coverity: 1466057 Unchecked return value --- 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)