#include "portable.h"
#include <stdio.h>
-#include <stdlib.h>
+
+#include <ac/stdlib.h>
#include <ac/ctype.h>
#include <ac/socket.h>
}
/* make working copy of the remainder of the URL */
- if (( url = strdup( url_tmp )) == NULL ) {
+ if (( url = LDAP_STRDUP( url_tmp )) == NULL ) {
return( LDAP_URL_ERR_MEM );
}
/* allocate return struct */
- if (( ludp = (LDAPURLDesc *)calloc( 1, sizeof( LDAPURLDesc )))
+ if (( ludp = (LDAPURLDesc *)LDAP_CALLOC( 1, sizeof( LDAPURLDesc )))
== NULLLDAPURLDESC )
{
- free( url );
+ LDAP_FREE( url );
return( LDAP_URL_ERR_MEM );
}
}
}
- if (( ludp->lud_attrs = (char **)calloc( nattrs + 1,
+ if (( ludp->lud_attrs = (char **)LDAP_CALLOC( nattrs + 1,
sizeof( char * ))) == NULL ) {
ldap_free_urldesc( ludp );
return( LDAP_URL_ERR_MEM );
{
if ( ludp != NULLLDAPURLDESC ) {
if ( ludp->lud_string != NULL ) {
- free( ludp->lud_string );
+ LDAP_FREE( ludp->lud_string );
}
if ( ludp->lud_attrs != NULL ) {
- free( ludp->lud_attrs );
+ LDAP_FREE( ludp->lud_attrs );
}
- free( ludp );
+ LDAP_FREE( ludp );
}
}
ludp->lud_filter, ludp->lud_attrs, attrsonly, NULL, NULL,
-1, -1 );
- if ( ber == NULLBER ) {
+ if ( ber == NULL ) {
return( -1 );
}
err = 0;
if ( ludp->lud_host != NULL || ludp->lud_port != 0 ) {
- if (( srv = (LDAPServer *)calloc( 1, sizeof( LDAPServer )))
- == NULL || ( srv->lsrv_host = strdup( ludp->lud_host ==
+ if (( srv = (LDAPServer *)LDAP_CALLOC( 1, sizeof( LDAPServer )))
+ == NULL || ( srv->lsrv_host = LDAP_STRDUP( ludp->lud_host ==
NULL ? ld->ld_defhost : ludp->lud_host )) == NULL ) {
if ( srv != NULL ) {
- free( srv );
+ LDAP_FREE( srv );
}
ld->ld_errno = LDAP_NO_MEMORY;
err = -1;