From e4d5f0a23f15b72169fe9d8535ef1eb87befbea3 Mon Sep 17 00:00:00 2001 From: Randy Kunkee Date: Wed, 3 Nov 1999 23:57:56 +0000 Subject: [PATCH] Clean up some memory problems. --- contrib/ldaptcl/neoXldap.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/contrib/ldaptcl/neoXldap.c b/contrib/ldaptcl/neoXldap.c index 76d1a2a121..d7e56a5d05 100644 --- a/contrib/ldaptcl/neoXldap.c +++ b/contrib/ldaptcl/neoXldap.c @@ -76,7 +76,6 @@ ** In OpenLDAP 2.x-devel, its 2000 + the draft number, ie 2002. ** This section is for OPENLDAP. */ -#define ldap_attributefree(p) ldap_memfree(p) #define ldap_memfree(p) free(p) #ifdef LDAP_OPT_ERROR_NUMBER #define ldap_get_lderrno(ld) (ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &lderrno), lderrno) @@ -89,7 +88,6 @@ /* ** Netscape SDK w/ ldap_set_option, ldap_get_option */ -#define ldap_attributefree(p) ldap_memfree(p) #define LDAP_ERR_STRING(ld) \ ldap_err2string(ldap_get_lderrno(ldap)) #else @@ -99,7 +97,6 @@ #define ldap_memfree(p) free(p) #define ldap_ber_free(p, n) ber_free(p, n) #define ldap_value_free_len(bvals) ber_bvecfree(bvals) -#define ldap_attributefree(p) #define ldap_get_lderrno(ld) (ld->ld_errno) #define LDAP_ERR_STRING(ld) \ ldap_err2string(ld->ld_errno) @@ -206,6 +203,7 @@ LDAP_ProcessOneSearchResult (interp, ldap, entry, destArrayNameObj, evalCodeObj) attributeDataObj, singleAttributeValueObj) == TCL_ERROR) { + ldap_ber_free(ber, 0); return TCL_ERROR; } } @@ -221,8 +219,8 @@ LDAP_ProcessOneSearchResult (interp, ldap, entry, destArrayNameObj, evalCodeObj) } Tcl_DecrRefCount (attributeNameObj); } - ldap_attributefree(attributeName); } + ldap_ber_free(ber, 0); return Tcl_EvalObj (interp, evalCodeObj); } -- 2.39.5