]> git.sur5r.net Git - openldap/commitdiff
Streamline call to lutil_passwd_scheme
authorHoward Chu <hyc@openldap.org>
Fri, 8 Jul 2005 06:05:02 +0000 (06:05 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 8 Jul 2005 06:05:02 +0000 (06:05 +0000)
servers/slapd/overlays/ppolicy.c

index af9804807ab3faf5477719284e6c7d53b37f8066..4b29520517dfc4e7b08e6e7d73abfa5102bbc7fb 100644 (file)
@@ -417,11 +417,7 @@ password_scheme( struct berval *cred, struct berval *sch )
        for(e = 1; cred->bv_val[e] && cred->bv_val[e] != '}'; e++);
        if (cred->bv_val[e]) {
                int rc;
-               char *sc = ch_calloc( sizeof(char), e + 2);
-               sc[e + 1] = '\0'; /* terminate string */
-               strncpy( sc, cred->bv_val, e + 1);
-               rc = lutil_passwd_scheme( sc );
-               free( sc );
+               rc = lutil_passwd_scheme( cred->bv_val );
                if (rc && sch) {
                        sch->bv_val = cred->bv_val;
                        sch->bv_len = e;