Netscape DIRECTORY SERVER 6.02 - PLUG-IN Manual page 376

Table of Contents

Advertisement

Functions for Managing Parameter Block
Memory Concerns
The parameter block that you wish to free must have been created using
slapi_pblock_new()
example,
and may lead to memory errors and memory leaks. For example:
Slapi_PBlock *pb = malloc(sizeof(Slapi_PBlock));
After calling this function, you should set the
reusing freed memory in your function context, as in the following:
slapi_pblock_destroy(pb);
pb =NULL;
If you reuse the pointer in this way, it makes it easier to identify a Segmentation
Fault, rather than using some difficult method to detect memory leaks or other
abnormal behavior.
It is safe to call this function with a NULL pointer. For example:
Slapi_PBlock *pb = NULL;
slapi_pblock_destroy(pb);
This saves the trouble of checking for NULL before calling
slapi_pblock_destroy()
See Also
slapi_pblock_new()
slapi_pblock_get()
Gets the value of a name-value pair from a parameter block.
Syntax
#include "slapi-plugin.h"
int slapi_pblock_get( Slapi_PBlock *pb, int arg, void *value );
Parameters
This function takes the following parameters:
pb
arg
value
376
Netscape Directory Server Plug-In Programmer's Guide • May 2002
. Use of this function with
;), or using another memory allocator, is not supported
Slapi_PBlock pb
.
Parameter block.
ID of the name-value pair that you want to get. For a list of IDs that you
can specify, see Chapter 15, "Parameter Block Reference."
Pointer to the value retrieved from the parameter block.
allocated on the stack (for
pblocks
pointer to
pblock
NULL
to avoid

Advertisement

Table of Contents
loading

This manual is also suitable for:

Directory server 6.02

Table of Contents