covoar: Fix NULL check of wrong variable (CID #1399602)

CID 1399602: Dereference null return value in
Explanations::writeNotFound().

In Explanations::writeNotFound() there were two NULL checks of the
`fileName` variable where only one is needed. The second check has been
changed to a NULL check of `notFoundFile` to match the original intent.

Closes #4377
This commit is contained in:
Alex White 2021-04-05 11:40:03 -05:00 committed by Joel Sherrill
parent de185fe1a9
commit e84b9f3a94

View File

@ -140,10 +140,10 @@ done:
return;
notFoundFile = fopen( fileName, "w" );
if (!fileName) {
if (notFoundFile == nullptr) {
std::ostringstream what;
what << "Unable to open " << fileName
<< "out of sync at the explanation";
<< " out of sync at the explanation";
throw rld::error( what, "Explanations::writeNotFound" );
}