Skip to content

Commit

Permalink
Assert if we don't have a valid connection
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Mar 23, 2013
1 parent f2ac543 commit 9f4d121
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/modules/rlm_ldap/ldap.c
Expand Up @@ -432,6 +432,8 @@ ldap_rcode_t rlm_ldap_bind(const ldap_instance_t *inst, REQUEST *request, ldap_h
const char *error = NULL;
char *extra = NULL;

rad_assert(*pconn && (*pconn)->handle);

/*
* Bind as anonymous user
*/
Expand Down Expand Up @@ -538,6 +540,8 @@ ldap_rcode_t rlm_ldap_search(const ldap_instance_t *inst, REQUEST *request, ldap
const char *error = NULL;
char *extra = NULL;

rad_assert(*pconn && (*pconn)->handle);

/*
* OpenLDAP library doesn't declare attrs array as const, but
* it really should be *sigh*.
Expand Down Expand Up @@ -637,6 +641,8 @@ ldap_rcode_t rlm_ldap_modify(const ldap_instance_t *inst, REQUEST *request, ldap
const char *error = NULL;
char *extra = NULL;

rad_assert(*pconn && (*pconn)->handle);

/*
* Perform all modifications as the admin user.
*/
Expand Down

0 comments on commit 9f4d121

Please sign in to comment.