From 83c492f74ec9f8990721641e9a70b104b18fca6d Mon Sep 17 00:00:00 2001 From: Arran Cudbard-Bell Date: Tue, 2 Feb 2016 15:11:17 -0500 Subject: [PATCH] Quiet clang scan --- src/modules/rlm_ldap/ldap.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/modules/rlm_ldap/ldap.c b/src/modules/rlm_ldap/ldap.c index 768e711..6aa9ee8 100644 --- a/src/modules/rlm_ldap/ldap.c +++ b/src/modules/rlm_ldap/ldap.c @@ -1331,6 +1331,8 @@ int rlm_ldap_global_init(rlm_ldap_t *inst) { int ldap_errno; + rad_assert(inst); /* clang scan */ + #define do_ldap_global_option(_option, _name, _value) \ if (ldap_set_option(NULL, _option, _value) != LDAP_OPT_SUCCESS) { \ ldap_get_option(NULL, LDAP_OPT_ERROR_NUMBER, &ldap_errno); \ @@ -1342,7 +1344,12 @@ int rlm_ldap_global_init(rlm_ldap_t *inst) #define maybe_ldap_global_option(_option, _name, _value) \ if (_value) do_ldap_global_option(_option, _name, _value) - maybe_ldap_global_option(LDAP_OPT_DEBUG_LEVEL, "ldap_debug", &(inst->ldap_debug)); +#ifdef LDAP_OPT_DEBUG_LEVEL + /* + * Can't use do_ldap_global_option + */ + if (inst->ldap_debug) do_ldap_global_option(LDAP_OPT_DEBUG_LEVEL, "ldap_debug", &(inst->ldap_debug)); +#endif #ifdef LDAP_OPT_X_TLS_RANDOM_FILE /* -- 2.1.4