Skip to content
Snippets Groups Projects
Commit 120b7fed authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Add strdup.c from -llutil, renamed to ldap_strdup() and always used.

This will allow us to substitute malloc() at a later date.
parent 05059be1
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
#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 );
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment