Restore the check for sudoers_policy.close == NULL.

The fuzzers run as part of "make check" too in which case NO_LEAKS
won't be defined and the close function will be set to NULL.
This commit is contained in:
Todd C. Miller
2021-02-18 07:58:34 -07:00
parent e047e99306
commit f76c59fc8f

View File

@@ -341,7 +341,10 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
}
/* Free resources. */
sudoers_policy.close(0, 0);
if (sudoers_policy.close != NULL)
sudoers_policy.close(0, 0);
else
sudoers_cleanup();
/* Call a second time to free old env pointer. */
env_init(NULL);