]> git.sur5r.net Git - openldap/commitdiff
Plug memory leaks
authorHallvard Furuseth <hallvard@openldap.org>
Mon, 23 Nov 1998 04:35:26 +0000 (04:35 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Mon, 23 Nov 1998 04:35:26 +0000 (04:35 +0000)
servers/slapd/schemaparse.c
servers/slapd/tools/ldif2id2children.c

index 96e01f09b0afa5ea0e2d454b5b5925ee0e02b0fb..08640bda5edcf3a36c9900d69b3ad1cb42ffb9f2 100644 (file)
@@ -36,9 +36,10 @@ parse_oc(
                        do {
                                i++;
                                if ( i < argc ) {
+                                       char **s = str2charray( argv[i], "," );
                                        last = argv[i][strlen( argv[i] ) - 1];
-                                       charray_merge( &oc->oc_required,
-                                               str2charray( argv[i], "," ) );
+                                       charray_merge( &oc->oc_required, s );
+                                       charray_free( s );
                                }
                        } while ( i < argc && last == ',' );
 
@@ -47,9 +48,11 @@ parse_oc(
                        do {
                                i++;
                                if ( i < argc ) {
+                                       char **s = str2charray( argv[i], "," );
                                        last = argv[i][strlen( argv[i] ) - 1];
-                                       charray_merge( &oc->oc_allowed,
-                                               str2charray( argv[i], "," ) );
+                                       
+                                       charray_merge( &oc->oc_allowed, s );
+                                       charray_free( s );
                                }
                        } while ( i < argc && last == ',' );
 
index 4c802e1f4412684a2ccb19c323479fecb5103b6e..5e709dc9bc44d5387f9784823d4563b82d7dc57d 100644 (file)
@@ -270,6 +270,7 @@ main( int argc, char **argv )
 
                                                data = ldbm_fetch( db->dbc_db,
                                                    key );
+                                               free( dn );
                                                if ( data.dptr == NULL ) {
                                                        dn_normalize( val );
                                                        if ( ! be_issuffix( be,