From: Arran Cudbard-Bell Date: Sat, 20 May 2023 18:46:52 +0000 (-0400) Subject: ldap: Verify we have an entry before trying to print the DN X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e040b2f4b0473ba39f47b748cff2d56fb8a9851b;p=thirdparty%2Ffreeradius-server.git ldap: Verify we have an entry before trying to print the DN --- diff --git a/src/modules/rlm_ldap/groups.c b/src/modules/rlm_ldap/groups.c index 7af8598c0b0..42a3c955e9a 100644 --- a/src/modules/rlm_ldap/groups.c +++ b/src/modules/rlm_ldap/groups.c @@ -741,9 +741,11 @@ static unlang_action_t ldap_check_groupobj_resume(rlm_rcode_t *p_result, UNUSED LDAPMessage *entry = NULL; char *dn = NULL; entry = ldap_first_entry(query->ldap_conn->handle, query->result); - if (entry) dn = ldap_get_dn(query->ldap_conn->handle, entry); - RDEBUG2("User found in group object \"%pV\"", fr_box_strvalue(dn)); - ldap_memfree(dn); + if (entry) { + dn = ldap_get_dn(query->ldap_conn->handle, entry); + RDEBUG2("User found in group object \"%pV\"", fr_box_strvalue(dn)); + ldap_memfree(dn); + } } break;