From ff5b6dbb609a76b32f2f6bffba8ecdcd986e1f69 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 14 Jul 2015 13:56:29 -0600 Subject: [PATCH] Add missing check for calloc(3) return value. --- plugins/sudoers/ldap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/sudoers/ldap.c b/plugins/sudoers/ldap.c index 9addea4f7..e4c451f97 100644 --- a/plugins/sudoers/ldap.c +++ b/plugins/sudoers/ldap.c @@ -2797,7 +2797,8 @@ sudo_ldap_result_alloc(void) debug_decl(sudo_ldap_result_alloc, SUDOERS_DEBUG_LDAP) result = calloc(1, sizeof(*result)); - STAILQ_INIT(&result->searches); + if (result != NULL) + STAILQ_INIT(&result->searches); debug_return_ptr(result); } -- 2.50.1