Skip to content
Snippets Groups Projects
Commit d218a5ed authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Add SLAP_MALLOC() and friends.

Intended to be used instead of ch_malloc() and friends.
See comment.
parent eaf32641
No related branches found
No related tags found
No related merge requests found
......@@ -35,14 +35,31 @@
#include "ldap_queue.h"
LDAP_BEGIN_DECL
#define SERVICE_NAME OPENLDAP_PACKAGE "-slapd"
#define SLAPD_ANONYMOUS "cn=anonymous"
/*
* SLAPD Memory allocation macros
*
* Unlike ch_*() routines, these routines do not assert() upon
* allocation error. They are intended to be used instead of
* ch_*() routines where the caller has implemented proper
* checking for and handling of allocation errors.
*
* Patches to convert ch_*() calls to SLAP_*() calls welcomed.
*/
#define SLAP_MALLOC(s) ber_memalloc((s))
#define SLAP_CALLOC(n,s) ber_memcalloc((n),(s))
#define SLAP_REALLOC(p,s) ber_memrealloc((p),(s))
#define SLAP_FREE(p) ber_memfree((p))
#define SLAP_VFREE(v) ber_memvfree((void**)(v))
#define SLAP_STRDUP(s) ber_strdup((s))
#define SLAP_STRNDUP(s,l) ber_strndup((s),(l))
#ifdef f_next
#undef f_next /* name conflict between sys/file.h on SCO and struct filter */
#endif
#define SERVICE_NAME OPENLDAP_PACKAGE "-slapd"
#define SLAPD_ANONYMOUS "cn=anonymous"
/* LDAPMod.mod_op value ===> Must be kept in sync with ldap.h!
*
* This is a value used internally by the backends. It is needed to allow
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment