common: Fix check_after_deref in cockpit_certificate_locate()
There is no need to check `error` in the condition, as the code above already dereferences it. Spotted by Coverity.
This commit is contained in:
parent
c05a36219b
commit
f2e885341d
|
@ -99,6 +99,7 @@ cockpit_certificate_locate (bool missing_ok,
|
|||
{
|
||||
const char * const *dirs = cockpit_conf_get_dirs ();
|
||||
|
||||
assert (error != NULL);
|
||||
assert (*error == NULL);
|
||||
|
||||
for (int i = 0; dirs[i]; i++)
|
||||
|
@ -117,7 +118,7 @@ cockpit_certificate_locate (bool missing_ok,
|
|||
return cert_path;
|
||||
}
|
||||
|
||||
if (error && !missing_ok)
|
||||
if (!missing_ok)
|
||||
asprintfx (error, "No certificate found in dir: %s/cockpit/ws-certs.d", dirs[0]);
|
||||
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in New Issue