From 9f8adeb2892f73d34b7e461716817456a64cfedf Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sat, 8 Jan 2011 12:49:38 +0000 Subject: [PATCH] make sure cred is freed --- clients/tools/ldapvc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clients/tools/ldapvc.c b/clients/tools/ldapvc.c index 9cdd44c901..49ac406aa0 100644 --- a/clients/tools/ldapvc.c +++ b/clients/tools/ldapvc.c @@ -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 ); -- 2.39.5