This will allow us to substitute malloc() at a later date.
/*
* 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
--- /dev/null
+#include "portable.h"
+
+#include <stdlib.h>
+#include <ac/string.h>
+#include <ac/time.h>
+
+#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 );
+}