Topology plugins sigsev/heap corruption when adding a managed host

A managed host may handle several ipaReplTopoManagedSuffix.
Removing (from the topology) such host, loops over the replicated
suffixes array to retrieve, in the hosts list, the host record and delete it.
The problem is that a variable used to manage a hosts list is not reset
when looking at the next suffix. That will messup the lists, keeping
freed elements in the lists.

The fix is to reset the variable inside the replicated suffix loop

https://fedorahosted.org/freeipa/ticket/5977

Reviewed-By: Ludwig Krispenz <lkrispen@redhat.com>
This commit is contained in:
root 2016-06-22 16:36:15 +02:00 committed by Martin Basti
parent 9a8c5c9dfd
commit a76d4402a6

View File

@ -528,6 +528,7 @@ ipa_topo_cfg_host_del(Slapi_Entry *hostentry)
slapi_lock_mutex(replica->repl_lock);
hostnode = replica->hosts;
prevnode = NULL;
while (hostnode) {
if (!strcasecmp(hostnode->hostname,delhost)) {
/*remove from list and free*/