]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/ch_malloc.c
Import add.c cache_set_state deadlock fix.
[openldap] / servers / slapd / ch_malloc.c
index 366e7bc1f17972b09ecefd3f648ce6a58c48bff5..2c7f850520d6ce03f8406d94680e1d75f3bee38f 100644 (file)
@@ -3,6 +3,7 @@
 #include "portable.h"
 
 #include <stdio.h>
+#include <stdlib.h>
 
 #include <ac/string.h>
 #include <ac/socket.h>
@@ -60,3 +61,19 @@ ch_calloc(
 
        return( new );
 }
+
+char *
+ch_strdup(
+    const char *string
+)
+{
+       char    *new;
+
+       if ( (new = strdup( string )) == NULL ) {
+               Debug( LDAP_DEBUG_ANY, "strdup(%s) failed\n", string, 0, 0 );
+               exit( 1 );
+       }
+
+       return( new );
+}
+