Don't clear errors on failure in CONF_modules_load_file_ex()
The call to CONF_modules_load() in CONF_modules_load_file_ex() can
return a negative number to indicate failure. This was incorrectly
being interpreted as "success" and therefore errors were being cleared
incorrectly.
@@ -187,10 +187,11 @@ int CONF_modules_load_file_ex(OSSL_LIB_CTX *libctx, const char *filename,
if ((flags & CONF_MFLAGS_IGNORE_RETURN_CODES) != 0 && !diagnostics)
ret = 1;
- if (ret)
+ if (ret > 0)
ERR_pop_to_mark();
else
ERR_clear_last_mark();
+
return ret;
}
