diff --git a/libraries/libldap/ldap-int.h b/libraries/libldap/ldap-int.h index 09628931fc..4b95a75f4f 100644 --- a/libraries/libldap/ldap-int.h +++ b/libraries/libldap/ldap-int.h @@ -242,12 +242,7 @@ BerElement *ldap_build_search_req( LDAP *ld, char *base, int scope, /* * in strdup.c */ -#ifdef HAVE_STRDUP -#define ldap_strdup(s) strdup(s) -extern char *strdup(); -#else -extern char *ldap_strdup LDAP_P(( const char * )); -#endif +char *ldap_strdup LDAP_P(( const char * )); /* * in unbind.c diff --git a/libraries/libldap/strdup.c b/libraries/libldap/strdup.c new file mode 100644 index 0000000000..b0541715ff --- /dev/null +++ b/libraries/libldap/strdup.c @@ -0,0 +1,19 @@ +#include "portable.h" + +#include +#include +#include + +#include "ldap-int.h" + +char *(ldap_strdup)( const char *s ) +{ + char *p; + + if ( (p = (char *) malloc( strlen( s ) + 1 )) == NULL ) + return( (char *)0 ); + + strcpy( p, s ); + + return( p ); +}