Status should always be initialised in rlm_ldap_bind
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 28 May 2014 19:13:37 +0000 (20:13 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 28 May 2014 19:13:44 +0000 (20:13 +0100)
We'll never actually hit this (it would require fr_connection_get_num to return a negative value).

src/modules/rlm_ldap/ldap.c

index 139f309..034d44d 100644 (file)
@@ -489,9 +489,7 @@ static ldap_rcode_t rlm_ldap_result(ldap_instance_t const *inst, ldap_handle_t c
                ldap_memfree(part_dn);
        }
 
-       if (our_err) {
-               talloc_free(our_err);
-       }
+       talloc_free(our_err);
 
        if ((lib_errno || srv_errno) && *result) {
                ldap_msgfree(*result);
@@ -516,7 +514,7 @@ static ldap_rcode_t rlm_ldap_result(ldap_instance_t const *inst, ldap_handle_t c
 ldap_rcode_t rlm_ldap_bind(ldap_instance_t const *inst, REQUEST *request, ldap_handle_t **pconn, char const *dn,
                           char const *password, bool retry)
 {
-       ldap_rcode_t    status;
+       ldap_rcode_t    status = LDAP_PROC_ERROR;
 
        int             msgid;