Chapter 35. Functions for Managing Parameter Block
Table 35.1. Parameter Block Routines
| Function | Description |
|---|---|
| slapi_pblock_destroy() | Frees a pblock from memory. |
| slapi_pblock_get() | Gets the value from a pblock. |
| Section 35.3, “slapi_pblock_init()” | Initializes an existing parameter block so that it can be reused. |
| slapi_pblock_new() | Creates a new pblock. |
| slapi_pblock_set() | Sets the value of a pblock. |
35.1. slapi_pblock_destroy()
#include "slapi-plugin.h" void slapi_pblock_destroy( Slapi_PBlock *pb );
This function takes the following parameter:
|
pb
| Parameter block that you want to free. |
The parameter block that you wish to free must have been created using slapi_pblock_new(). Use of this function with pblock allocated on the stack (for example, Slapi_PBlock pb;) or using another memory allocator is not supported and may lead to memory errors and memory leaks. For example:
Slapi_PBlock *pb = malloc(sizeof(Slapi_PBlock));
NULL to avoid reusing freed memory in your function context, as in the following:
slapi_pblock_destroy(pb); pb = NULL;
Slapi_PBlock *pb = NULL; slapi_pblock_destroy(pb);
slapi_pblock_destroy().

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.