]> git.sur5r.net Git - openldap/commitdiff
Fix error handling
authorKurt Zeilenga <kurt@openldap.org>
Thu, 28 Nov 2002 04:36:22 +0000 (04:36 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 28 Nov 2002 04:36:22 +0000 (04:36 +0000)
libraries/libldap/passwd.c
libraries/libldap/whoami.c

index d2d32b58a51284382ed095edda82abbc195ba7c6..a186abe0402c6c35c385c057b1a73fd1d12a6f75 100644 (file)
@@ -146,6 +146,10 @@ ldap_passwd_s(
        }
 
        rc = ldap_parse_passwd( ld, res, newpasswd );
-       ldap_msgfree( res );
-       return rc;
+       if( rc != LDAP_SUCCESS ) {
+               ldap_msgfree( res );
+               return rc;
+       }
+
+       return( ldap_result2error( ld, res, 1 ) );
 }
index 3ad13869c9d5c03c56767aefd40b62d18b43a9d1..23fe395301db73cfb72d8a64074985df8d797b27 100644 (file)
@@ -80,6 +80,10 @@ ldap_whoami_s(
        }
 
        rc = ldap_parse_whoami( ld, res, authzid );
-       ldap_msgfree( res );
-       return rc;
+       if( rc != LDAP_SUCCESS ) {
+               ldap_msgfree( res );
+               return rc;
+       }
+
+       return( ldap_result2error( ld, res, 1 ) );
 }