diff --git a/mozilla/directory/perldap/API.xs b/mozilla/directory/perldap/API.xs index 03d7a8416e6..799a3748af4 100644 --- a/mozilla/directory/perldap/API.xs +++ b/mozilla/directory/perldap/API.xs @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: API.xs,v 1.15 1998-08-13 22:40:53 leif Exp $ + * $Id: API.xs,v 1.15.2.1 1998-09-20 03:21:55 donley%tekka.wwa.com Exp $ * * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in @@ -118,7 +118,7 @@ struct berval ** avref2berptrptr(SV *avref) I32 avref_arraylen; int ix_av,val_len; SV **current_val; - char *tmp_char; + char *tmp_char,*tmp2; struct berval **tmp_ber; if (SvTYPE(SvRV(avref)) != SVt_PVAV || @@ -132,11 +132,14 @@ struct berval ** avref2berptrptr(SV *avref) { New(1,tmp_ber[ix_av],1,struct berval); current_val = av_fetch((AV *)SvRV(avref),ix_av,0); + + tmp_char = SvPV(*current_val,na); val_len = SvCUR(*current_val); - Newz(1,tmp_char,val_len+1,char); - Copy(SvPV(*current_val,na),tmp_char,val_len,char); - tmp_ber[ix_av]->bv_val = tmp_char; + Newz(1,tmp2,val_len+1,char); + Copy(tmp_char,tmp2,val_len,char); + + tmp_ber[ix_av]->bv_val = tmp2; tmp_ber[ix_av]->bv_len = val_len; } tmp_ber[ix_av] = NULL; @@ -479,6 +482,13 @@ void ldap_ber_free(ber,freebuf) BerElement * ber int freebuf + CODE: + { + if (ber) + { + ldap_ber_free(ber,freebuf); + } + } int ldap_bind(ld,dn,passwd,authmethod) @@ -1052,6 +1062,15 @@ ldap_mods_free(mods,freemods) int ldap_msgfree(lm) LDAPMessage * lm + CODE: + { + if (lm) + { + RETVAL = ldap_msgfree(lm); + } + } + OUTPUT: + RETVAL int ldap_msgid(lm) diff --git a/mozilla/directory/perldap/test_api/api.pl b/mozilla/directory/perldap/test_api/api.pl index 8911e730240..f60c3147f11 100755 --- a/mozilla/directory/perldap/test_api/api.pl +++ b/mozilla/directory/perldap/test_api/api.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w ############################################################################# -# $Id: api.pl,v 1.6 1998-08-13 04:40:00 clayton Exp $ +# $Id: api.pl,v 1.6.2.1 1998-09-20 03:21:58 donley%tekka.wwa.com Exp $ # # The contents of this file are subject to the Mozilla Public License # Version 1.0 (the "License"); you may not use this file except in @@ -12,7 +12,7 @@ # License for the specific language governing rights and limitations # under the License. # -# The Original Code is PerlDAP. The Initial Developer of the Original +# The Original Code is PerLDAP. The Initial Developer of the Original # Code is Netscape Communications Corp. and Clayton Donley. Portions # created by Netscape are Copyright (C) Netscape Communications # Corp., portions created by Clayton Donley are Copyright (C) Clayton @@ -44,6 +44,10 @@ if (!$HOST) exit -1; } +print "\nPerLDAP API TestSuite\n"; +print "\nNote: Failures in earlier tests will cause later tests to fail.\n"; +print "\n"; + my $howmany = 10; # Initialize the Connection @@ -132,8 +136,9 @@ foreach my $number (1..$howmany) foreach my $number (1..$howmany) { $entry = { - "sn" => {"a",["Test"]}, - "telephoneNumber" => "800-555-111$number", + "sn" => {"ab",["Test"]}, + "telephoneNumber" => {"ab",[123.456]}, +# "telephoneNumber" => "800-555-111$number", }; if (ldap_modify_s($ld,"cn=Mozilla $number,$BASE",$entry) != LDAP_SUCCESS)