#include "slap.h"
-void entry_free();
-char *entry2str();
-
static unsigned char *ebuf; /* buf returned by entry2str */
static unsigned char *ecur; /* pointer to end of currently used ebuf */
static int emaxsize;/* max size of ebuf */
s ? s : "NULL", 0, 0 );
e = (Entry *) ch_calloc( 1, sizeof(Entry) );
- /* initialize reader/writer lock */
- entry_rdwr_init(e);
/* check to see if there's an id included */
next = s;
Debug( LDAP_DEBUG_TRACE,
"<= str2entry NULL (missing newline after id)\n",
0, 0, 0 );
+ free( e );
return( NULL );
}
}
+ /* initialize reader/writer lock */
+ entry_rdwr_init(e);
+
/* dn + attributes */
e->e_attrs = NULL;
vals[0] = &bval;
if ( strcasecmp( type, "dn" ) == 0 ) {
if ( e->e_dn != NULL ) {
Debug( LDAP_DEBUG_ANY,
- "str2entry: entry %d has multiple dns \"%s\" and \"%s\" (second ignored)\n",
+ "str2entry: entry %lu has multiple dns \"%s\" and \"%s\" (second ignored)\n",
e->e_id, e->e_dn, value );
continue;
}
- e->e_dn = strdup( value );
+ e->e_dn = ch_strdup( value );
continue;
}
!= 0 ) {
Debug( LDAP_DEBUG_TRACE,
"<= str2entry NULL (attr_merge)\n", 0, 0, 0 );
+ entry_free( e );
return( NULL );
}
nvals++;
/* check to make sure there was a dn: line */
if ( e->e_dn == NULL ) {
- Debug( LDAP_DEBUG_ANY, "str2entry: entry %d has no dn\n",
+ Debug( LDAP_DEBUG_ANY, "str2entry: entry %lu has no dn\n",
e->e_id, 0, 0 );
entry_free( e );
return( NULL );
}
- Debug( LDAP_DEBUG_TRACE, "<= str2entry 0x%x\n", e, 0, 0 );
+ Debug(LDAP_DEBUG_TRACE, "<= str2entry 0x%lx\n", (unsigned long)e, 0,0);
return( e );
}
{
return pthread_rdwr_init_np(&e->e_rdwr, NULL);
}
-