]> git.sur5r.net Git - openldap/commitdiff
don't leak in case of error
authorPierangelo Masarati <ando@openldap.org>
Fri, 17 Aug 2007 09:47:14 +0000 (09:47 +0000)
committerPierangelo Masarati <ando@openldap.org>
Fri, 17 Aug 2007 09:47:14 +0000 (09:47 +0000)
libraries/libldap/dds.c

index 88ec16f4bd13a15cd8592d83aee36ce2e3c2e16f..e3c986d89edbe69860b795a2a1ab8bfd46ada78c 100644 (file)
@@ -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;