+ return( pPB );
+}
+#endif /* LDAP_SLAPI */
+
+Slapi_PBlock *
+slapi_add_entry_internal(
+ Slapi_Entry *e,
+ LDAPControl **controls,
+ int log_changes )
+{
+#ifdef LDAP_SLAPI
+ Slapi_PBlock *pb = NULL;
+ Slapi_Entry *entry = NULL;
+ Connection *pConn = NULL;
+
+ pConn = slapi_int_init_connection( NULL, LDAP_REQ_ADD );
+ if ( pConn == NULL ) {
+ return NULL;
+ }
+
+ /*
+ * We make a copy to avoid an entry that may be freed later
+ * by the caller being placed in the cache.
+ */
+ entry = slapi_entry_dup( e );
+ pb = slapi_int_add_entry_locked( pConn, &entry, controls, log_changes );
+ if ( entry != NULL ) {
+ slapi_entry_free( entry );