]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/dds.c
ITS#7022 cleanup prev commit
[openldap] / libraries / libldap / dds.c
index bfaf9b7fb3667a36366b0d493aa7b6a2e9d18f0b..3c95eb4f3dac3f0f698afd6ebd4e5d93fc803848 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2005-2007 The OpenLDAP Foundation.
+ * Copyright 2005-2011 The OpenLDAP Foundation.
  * Portions Copyright 2005-2006 SysNet s.n.c.
  * All rights reserved.
  *
@@ -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;
@@ -142,7 +143,7 @@ ldap_refresh_s(
        if ( rc != LDAP_SUCCESS ) return rc;
        
        rc = ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *)NULL, &res );
-       if( rc == -1 ) return ld->ld_errno;
+       if( rc == -1 || !res ) return ld->ld_errno;
 
        rc = ldap_parse_refresh( ld, res, newttl );
        if( rc != LDAP_SUCCESS ) {