From: Arran Cudbard-Bell Date: Tue, 2 Feb 2016 20:11:17 +0000 (-0500) Subject: Quiet clang scan X-Git-Tag: release_3_0_12~252 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83c492f74ec9f8990721641e9a70b104b18fca6d;p=thirdparty%2Ffreeradius-server.git Quiet clang scan --- diff --git a/src/modules/rlm_ldap/ldap.c b/src/modules/rlm_ldap/ldap.c index 768e7110f87..6aa9ee80f3a 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 /*