| |
@@ -1649,6 +1649,45 @@
|
| |
cbdata->entries_tail = NULL;
|
| |
}
|
| |
|
| |
+ static void
|
| |
+ backend_search_free_staged(struct backend_search_cbdata *cbdata)
|
| |
+ {
|
| |
+ struct backend_staged_search *staged, *next;
|
| |
+ int i;
|
| |
+ int nb_entries = 0;
|
| |
+ int nb_stages = 0;
|
| |
+
|
| |
+ if (cbdata == NULL) {
|
| |
+ return;
|
| |
+ }
|
| |
+
|
| |
+ staged = cbdata->staged;
|
| |
+ while (staged != NULL) {
|
| |
+ nb_stages++;
|
| |
+ for (i = 0;
|
| |
+ (i < staged->count) &&
|
| |
+ (staged->entries != NULL) &&
|
| |
+ (staged->entries[i] != NULL);
|
| |
+ i++) {
|
| |
+ slapi_entry_free(staged->entries[i]);
|
| |
+ staged->entries[i] = NULL;
|
| |
+ }
|
| |
+ nb_entries += i;
|
| |
+ slapi_ch_free_string(&staged->map_group);
|
| |
+ slapi_ch_free_string(&staged->map_set);
|
| |
+ slapi_ch_free_string(&staged->name);
|
| |
+ slapi_ch_free_string(&staged->container_sdn);
|
| |
+ next = staged->next;
|
| |
+ free(staged);
|
| |
+ staged = next;
|
| |
+ }
|
| |
+ slapi_log_error(SLAPI_LOG_PLUGIN,
|
| |
+ cbdata->state->plugin_desc->spd_id,
|
| |
+ "backend_search_free_staged freed %d stages with %d entries\n",
|
| |
+ nb_stages,
|
| |
+ nb_entries);
|
| |
+ cbdata->staged = NULL;
|
| |
+ }
|
| |
static int
|
| |
backend_search_cb(Slapi_PBlock *pb)
|
| |
{
|
| |
@@ -1853,6 +1892,7 @@
|
| |
map_unlock();
|
| |
/* Return newly acquired entries */
|
| |
backend_send_mapped_entries(&cbdata);
|
| |
+ backend_search_free_staged(&cbdata);
|
| |
} else {
|
| |
slapi_log_error(SLAPI_LOG_PLUGIN,
|
| |
cbdata.state->plugin_desc->spd_id,
|
| |
When slapi-nis retrieves the entries addec by nsswitch search
it fills 'staged' structures.
Those structures should be freed once the entries have been returned
https://bugzilla.redhat.com/show_bug.cgi?id=1750893