]> git.sur5r.net Git - openldap/commitdiff
Plug leaks
authorHoward Chu <hyc@openldap.org>
Fri, 31 Mar 2006 09:18:38 +0000 (09:18 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 31 Mar 2006 09:18:38 +0000 (09:18 +0000)
tests/progs/slapd-tester.c

index a430a45277f9068cdc3aef05c1095fc27fee4e3e..03d47f3c21ea3d69802ab9da310da18c6cde6a97 100644 (file)
@@ -730,11 +730,14 @@ get_read_entries( char *filename, char *entries[], char *filters[] )
                                LDAPURLDesc     *lud;
 
                                if ( ldap_url_parse( &line[1], &lud ) != LDAP_URL_SUCCESS ) {
-                                       return -1;
+                                       entry = -1;
+                                       break;
                                }
 
                                if ( lud->lud_dn == NULL || lud->lud_dn[ 0 ] == '\0' ) {
-                                       return -1;
+                                       ldap_free_urldesc( lud );
+                                       entry = -1;
+                                       break;
                                }
 
                                entries[entry] = ArgDup( lud->lud_dn );
@@ -745,7 +748,7 @@ get_read_entries( char *filename, char *entries[], char *filters[] )
                                } else {
                                        filters[entry] = ArgDup( "(objectClass=*)" );
                                }
-
+                               ldap_free_urldesc( lud );
 
                        } else {
                                entries[entry] = ArgDup( line );