Create a completely new entry by using slapi_entry_alloc() to allocate the memory that is required, as shown in the following example.
#include "slapi-plugin.h"
int
test_ldif()
{
    Slapi_Entry * entry = NULL;        /* Entry to hold LDIF      */
    /* Allocate the Slapi_Entry structure.                        */
    entry = slapi_entry_alloc();
    /* Add code that fills the Slapi_Entry structure.             */
    /* Add code that uses the Slapi_Entry structure.              */
    /* Release memory allocated for the entry.                    */
    slapi_entry_free(entry);
    return (0);
}