From 8050701f56da9637e2c1d79313734c9f9132420e Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 6 Oct 2005 19:04:39 +0000 Subject: [PATCH] Plug memleak --- servers/slapd/ad.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 ) -- 2.39.5