From 6df2df130bcf20eb276129eb69978039ab89d5a5 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Fri, 17 Aug 2007 09:47:14 +0000 Subject: [PATCH] don't leak in case of error --- libraries/libldap/dds.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/libldap/dds.c b/libraries/libldap/dds.c index 88ec16f4bd..e3c986d89e 100644 --- a/libraries/libldap/dds.c +++ b/libraries/libldap/dds.c @@ -113,13 +113,14 @@ ldap_refresh( rc = ber_flatten2( ber, &bv, 0 ); if ( rc < 0 ) { - ld->ld_errno = LDAP_ENCODING_ERROR; - return ld->ld_errno; + rc = ld->ld_errno = LDAP_ENCODING_ERROR; + goto done; } rc = ldap_extended_operation( ld, LDAP_EXOP_REFRESH, &bv, sctrls, cctrls, msgidp ); +done:; ber_free( ber, 1 ); return rc; -- 2.39.5