]> git.sur5r.net Git - openldap/commitdiff
make sure cred is freed
authorPierangelo Masarati <ando@openldap.org>
Sat, 8 Jan 2011 12:49:38 +0000 (12:49 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 8 Jan 2011 12:49:38 +0000 (12:49 +0000)
clients/tools/ldapvc.c

index 9cdd44c90106c92036aa9378c716d613156fb80e..49ac406aa0aceb6c5b742757687320f7b6a14b63 100644 (file)
@@ -299,7 +299,7 @@ main( int argc, char *argv[] )
                dn = argv[optind++];
        }
        if (argc - optind > 0) {
-               cred.bv_val = argv[optind++];
+               cred.bv_val = strdup(argv[optind++]);
                cred.bv_len = strlen(cred.bv_val);
        }
        if (argc - optind > 0) {
@@ -501,6 +501,7 @@ skip:
        ber_bvfree( scookie );
        ber_bvfree( scred );
        ber_memfree( diag );
+       free( cred.bv_val );
 
        /* disconnect from server */
        tool_unbind( ld );