ITS#10349 Do not leak memberof_t

This commit is contained in:
Ondřej Kuzník 2025-06-13 08:02:33 +01:00 committed by Quanah Gibson-Mount
parent b4ed8cf783
commit 47e9cd7313

View file

@ -1681,11 +1681,6 @@ memberof_db_init(
const char *text = NULL;
int rc;
mo = (memberof_t *)ch_calloc( 1, sizeof( memberof_t ) );
/* safe default */
mo->mo_dangling_err = LDAP_CONSTRAINT_VIOLATION;
if ( !ad_memberOf ) {
rc = slap_str2ad( SLAPD_MEMBEROF_ATTR, &ad_memberOf, &text );
if ( rc != LDAP_SUCCESS ) {
@ -1717,6 +1712,11 @@ memberof_db_init(
}
}
mo = (memberof_t *)ch_calloc( 1, sizeof( memberof_t ) );
/* safe default */
mo->mo_dangling_err = LDAP_CONSTRAINT_VIOLATION;
on->on_bi.bi_private = (void *)mo;
return 0;