int ldap_parse_passwd(
LDAP *ld,
LDAPMessage *res,
- struct berval **newpasswd )
+ struct berval *newpasswd )
{
int rc;
char *retoid = NULL;
assert( res != NULL );
assert( newpasswd != NULL );
- *newpasswd = NULL;
+ newpasswd->bv_val = NULL;
+ newpasswd->bv_len = 0;
rc = ldap_parse_extended_result( ld, res, &retoid, &retdata, 0 );
}
/* we should check the tag */
- tag = ber_scanf( ber, "{O}", newpasswd );
+ tag = ber_scanf( ber, "{o}", newpasswd );
ber_free( ber, 1 );
if( tag == LBER_ERROR ) {
struct berval *user,
struct berval *oldpw,
struct berval *newpw,
- struct berval **newpasswd,
+ struct berval *newpasswd,
LDAPControl **sctrls,
LDAPControl **cctrls )
{
struct berval id = { 0, NULL };
struct berval old = { 0, NULL };
struct berval new = { 0, NULL };
- struct berval dn, mdn = { 0, NULL }, *newpw = NULL;
+ struct berval dn, mdn = { 0, NULL }, newpw;
LDAPMessage *res;
ber_int_t msgid;
char *msg = NULL, *match = NULL;
if (rc == LDAP_SUCCESS) {
if (err == LDAP_SUCCESS) {
rc = ldap_parse_passwd(lc->ld, res, &newpw);
- if (rc == LDAP_SUCCESS && newpw) {
- *rspdata = slap_passwd_return(newpw);
- ber_bvfree(newpw);
+ if (rc == LDAP_SUCCESS && newpw.bv_val) {
+ *rspdata = slap_passwd_return(&newpw);
+ free(newpw.bv_val);
}
} else {
rc = err;