From 02b71d58ec9637655cb0c95c3fbbae140df8d62b Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sun, 8 Mar 2009 00:11:25 +0000 Subject: [PATCH] ITS#6005 strings returned to slapd must use ber_mem* --- libraries/liblutil/passfile.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/liblutil/passfile.c b/libraries/liblutil/passfile.c index 3c44e91a4f..7e7edbaf0b 100644 --- a/libraries/liblutil/passfile.c +++ b/libraries/liblutil/passfile.c @@ -62,7 +62,7 @@ lutil_get_filed_password( } #endif /* HAVE_FSTAT */ - passwd->bv_val = (char *) malloc( passwd->bv_len + 1 ); + passwd->bv_val = (char *) ber_memalloc( passwd->bv_len + 1 ); if( passwd->bv_val == NULL ) { perror( filename ); return -1; @@ -73,10 +73,10 @@ lutil_get_filed_password( do { if( nleft == 0 ) { /* double the buffer size */ - char *p = (char *) realloc( passwd->bv_val, + char *p = (char *) ber_memrealloc( passwd->bv_val, 2 * passwd->bv_len + 1 ); if( p == NULL ) { - free( passwd->bv_val ); + ber_memfree( passwd->bv_val ); passwd->bv_val = NULL; passwd->bv_len = 0; return -1; @@ -89,7 +89,7 @@ lutil_get_filed_password( nr = fread( &passwd->bv_val[nread], 1, nleft, f ); if( nr < nleft && ferror( f ) ) { - free( passwd->bv_val ); + ber_memfree( passwd->bv_val ); passwd->bv_val = NULL; passwd->bv_len = 0; return -1; -- 2.39.5