os: reset packet_allocator members

Fixes #2632
This commit is contained in:
Alexander Boettcher 2018-02-13 16:28:31 +01:00 committed by Norman Feske
parent 70112d29da
commit e05a708024

View File

@ -88,8 +88,18 @@ class Genode::Packet_allocator : public Genode::Range_allocator
{ {
if (_base != base) return -1; if (_base != base) return -1;
if (_array) destroy(_md_alloc, _array); _base = _next = 0;
if (_bits) _md_alloc->free(_bits, _block_cnt(size)/8);
if (_array) {
destroy(_md_alloc, _array);
_array = nullptr;
}
if (_bits) {
_md_alloc->free(_bits, _block_cnt(size)/8);
_bits = nullptr;
}
return 0; return 0;
} }