This works as intended: ber_int_memory_fns is only used when passing ctx!=NULL to ber_memalloc_x() & co. slapd/sl_malloc.c does this. ber_memalloc() & co do not use it: As you say, they pass ctx=NULL. Closing this ITS.