mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-29 02:59:34 -05:00
Add SLAP_MALLOC() and friends.
Intended to be used instead of ch_malloc() and friends. See comment.
This commit is contained in:
parent
eaf3264184
commit
d218a5ed5c
1 changed files with 20 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue