From: Howard Chu Date: Thu, 6 Oct 2005 19:04:39 +0000 (+0000) Subject: Plug memleak X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~314 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8050701f56da9637e2c1d79313734c9f9132420e;p=openldap Plug memleak --- diff --git a/servers/slapd/ad.c b/servers/slapd/ad.c index 676cf8d86f..48b4b27219 100644 --- a/servers/slapd/ad.c +++ b/servers/slapd/ad.c @@ -988,8 +988,9 @@ anlist2attrs( AttributeName * anlist ) char **attrs; ObjectClass *oc; - attrs = anlist2charray( anlist, 1 ); - + if ( anlist == NULL ) + return NULL; + for ( i = 0; anlist[i].an_name.bv_val; i++ ) { if ( ( oc = anlist[i].an_oc ) ) { for ( j = 0; oc->soc_required && oc->soc_required[j]; j++ ) ; @@ -1002,6 +1003,8 @@ anlist2attrs( AttributeName * anlist ) if ( i == 0 ) return NULL; + attrs = anlist2charray( anlist, 1 ); + n = i; if ( k )