]> git.sur5r.net Git - openldap/commitdiff
Plug memleak
authorHoward Chu <hyc@openldap.org>
Thu, 6 Oct 2005 19:04:39 +0000 (19:04 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 6 Oct 2005 19:04:39 +0000 (19:04 +0000)
servers/slapd/ad.c

index 676cf8d86f39d2881600b2d4d7907132c5c8cbf2..48b4b272194f6f6bd5f29bf092d229472b96651d 100644 (file)
@@ -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 )