]> git.sur5r.net Git - openldap/commitdiff
Plug memory leaks
authorHallvard Furuseth <hallvard@openldap.org>
Mon, 1 Aug 2005 03:44:52 +0000 (03:44 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Mon, 1 Aug 2005 03:44:52 +0000 (03:44 +0000)
clients/tools/common.c
clients/tools/ldapmodify.c
clients/tools/ldapsearch.c

index c076b9f65ab6f290e7c4efac49b099f2bde2df72..78b713771c8a1c1cf48ea61da94573ba1a92ad7b 100644 (file)
@@ -717,6 +717,9 @@ tool_args( int argc, char **argv )
                                LDAP_VENDOR_NAME, LDAP_VENDOR_VERSION );
                        if (version > 1) exit( EXIT_SUCCESS );
                }
+
+               ldap_memfree( api.ldapai_vendor_name );
+               ldap_value_free( api.ldapai_extensions );
        }
 
        if (protocol == -1)
@@ -971,6 +974,9 @@ tool_bind( LDAP *ld )
                        }
                }
 #endif
+               if ( ctrls ) {
+                       ldap_controls_free( ctrls );
+               }
                if ( err != LDAP_SUCCESS || msgbuf[0] ) {
                        fprintf( stderr, "ldap_bind: %s%s\n", ldap_err2string( err ),
                                msgbuf );
index de2513ca26a427255a922e02398fd728ca86e56a..d1941e3bb8937d32619d210b46b2e11442452d4c 100644 (file)
@@ -720,6 +720,9 @@ end_line:
        if ( newrdn != NULL ) {
                free( newrdn );
        }
+       if ( newsup != NULL ) {
+               free( newsup );
+       }
        if ( pmods != NULL ) {
                ldap_mods_free( pmods, 1 );
        }
index 29bd04c939d6eb0c9d2edc3c9dca8aa72951730f..86b1c404a7babe2c35fd1be54c5cd491d2a0ee73 100644 (file)
@@ -603,7 +603,7 @@ main( int argc, char **argv )
        {
                filtpattern = "(objectclass=*)";
        } else {
-               filtpattern = strdup( argv[optind++] );
+               filtpattern = argv[optind++];
        }
 
        if ( argv[optind] != NULL ) {