openldap/libraries/libldap/strdup.c
Kurt Zeilenga 120b7fedae Add strdup.c from -llutil, renamed to ldap_strdup() and always used.
This will allow us to substitute malloc() at a later date.
1998-11-20 07:02:39 +00:00

19 lines
321 B
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 );
}