| |
@@ -1767,6 +1767,7 @@
|
| |
/* Perform another check, now for rewritten DN */
|
| |
cbdata.target_dn = slapi_sdn_new_dn_byval(target);
|
| |
map_data_foreach_domain(cbdata.state, backend_search_find_set_dn_cb, &cbdata);
|
| |
+
|
| |
/* Rewritten DN might still be outside of our trees */
|
| |
if (cbdata.answer == TRUE) {
|
| |
slapi_log_error(SLAPI_LOG_PLUGIN, cbdata.state->plugin_desc->spd_id,
|
| |
@@ -1774,19 +1775,21 @@
|
| |
"for \"%s\" with scope %d%s. Filter may get overridden later.\n",
|
| |
cbdata.idview, target, cbdata.strfilter, cbdata.scope,
|
| |
backend_sch_scope_as_string(cbdata.scope));
|
| |
- } else {
|
| |
- slapi_sdn_free(&cbdata.target_dn);
|
| |
- slapi_ch_free_string(&target);
|
| |
- slapi_ch_free_string(&cbdata.idview);
|
| |
+ }
|
| |
+
|
| |
+ slapi_sdn_free(&cbdata.target_dn);
|
| |
+ slapi_ch_free_string(&cbdata.idview);
|
| |
+
|
| |
+ if (cbdata.answer == FALSE) {
|
| |
slapi_log_error(SLAPI_LOG_PLUGIN,
|
| |
cbdata.state->plugin_desc->spd_id,
|
| |
"The search base didn't match any of the containers, "
|
| |
"ignoring search\n");
|
| |
+ slapi_ch_free_string(&target);
|
| |
return 0;
|
| |
}
|
| |
- } else {
|
| |
- slapi_ch_free_string(&target);
|
| |
}
|
| |
+ slapi_ch_free_string(&target);
|
| |
}
|
| |
cbdata.answer = FALSE;
|
| |
#endif
|
| |
When processing a search request, slapi-nis attempts to detect an ID
View lookup. A target DN is modified by extracting an ID view name. This
temporary string is freed in the successful case but left unotouched if
ID View wasn't requested. As a result, small leaks on each search
request accumulate and a memory can get lost.
Resolves: rhbz#1866113
Signed-off-by: Alexander Bokovoy abokovoy@redhat.com