]> git.sur5r.net Git - openldap/commitdiff
quick fix; needs work
authorPierangelo Masarati <ando@openldap.org>
Tue, 4 Jan 2011 00:08:12 +0000 (00:08 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 4 Jan 2011 00:08:12 +0000 (00:08 +0000)
clients/tools/ldapvc.c

index b4f8001acf786e283d1fd38d48ca06ec2dbe24b2..fbd85240bd127144248b6490258b6cb706d3598f 100644 (file)
@@ -194,7 +194,7 @@ main( int argc, char *argv[] )
     if (req_authzid) {
                vcctrls = (LDAPControl **) malloc(3*sizeof(LDAPControl *));
                vcctrls[nvcctrls] = (LDAPControl *) malloc(sizeof(LDAPControl));
-               vcctrls[nvcctrls]->ldctl_oid = LDAP_CONTROL_AUTHZID_REQUEST;
+               vcctrls[nvcctrls]->ldctl_oid = ldap_strdup(LDAP_CONTROL_AUTHZID_REQUEST);
                vcctrls[nvcctrls]->ldctl_iscritical = 0;
                vcctrls[nvcctrls]->ldctl_value.bv_val = NULL;
                vcctrls[nvcctrls]->ldctl_value.bv_len = 0;
@@ -202,9 +202,9 @@ main( int argc, char *argv[] )
     }
 
     if (req_pp) {
-               if (vcctrls) vcctrls = (LDAPControl **) malloc(3*sizeof(LDAPControl *));
+               if (!vcctrls) vcctrls = (LDAPControl **) malloc(3*sizeof(LDAPControl *));
                vcctrls[nvcctrls] = (LDAPControl *) malloc(sizeof(LDAPControl));
-               vcctrls[nvcctrls]->ldctl_oid = LDAP_CONTROL_PASSWORDPOLICYREQUEST;
+               vcctrls[nvcctrls]->ldctl_oid = ldap_strdup(LDAP_CONTROL_PASSWORDPOLICYREQUEST);
                vcctrls[nvcctrls]->ldctl_iscritical = 0;
                vcctrls[nvcctrls]->ldctl_value.bv_val = NULL;
                vcctrls[nvcctrls]->ldctl_value.bv_len = 0;