From f76c59fc8fb0f338975bce406c84524d0594bd75 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 18 Feb 2021 07:58:34 -0700 Subject: [PATCH] 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. --- plugins/sudoers/regress/fuzz/fuzz_policy.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/sudoers/regress/fuzz/fuzz_policy.c b/plugins/sudoers/regress/fuzz/fuzz_policy.c index 7f8b80dc2..2a18c46f9 100644 --- a/plugins/sudoers/regress/fuzz/fuzz_policy.c +++ b/plugins/sudoers/regress/fuzz/fuzz_policy.c @@ -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);