Init: bugfix

Fix a use-after-free bug concerning the use case where the config
of the init process changes dynamically. The childs' services were not
removed from the corresponding Service_registry properly.

Fixes #1094
This commit is contained in:
Johannes Schlatow 2014-03-13 13:13:21 +01:00 committed by Norman Feske
parent 0b7ea4abab
commit da9e764c47

View File

@ -557,7 +557,12 @@ namespace Init {
} catch (Xml_node::Nonexistent_sub_node) { }
}
virtual ~Child() { }
virtual ~Child() {
Genode::Service *s;
while ((s = _child_services->find_by_server(&_server))) {
_child_services->remove(s);
}
}
/**
* Return true if the child has the specified name