From e05a708024983fe9cfc069695e4db2516469daaa Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Tue, 13 Feb 2018 16:28:31 +0100 Subject: [PATCH] os: reset packet_allocator members Fixes #2632 --- repos/os/include/os/packet_allocator.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/repos/os/include/os/packet_allocator.h b/repos/os/include/os/packet_allocator.h index 326801515..67709fb9a 100644 --- a/repos/os/include/os/packet_allocator.h +++ b/repos/os/include/os/packet_allocator.h @@ -88,8 +88,18 @@ class Genode::Packet_allocator : public Genode::Range_allocator { if (_base != base) return -1; - if (_array) destroy(_md_alloc, _array); - if (_bits) _md_alloc->free(_bits, _block_cnt(size)/8); + _base = _next = 0; + + if (_array) { + destroy(_md_alloc, _array); + _array = nullptr; + } + + if (_bits) { + _md_alloc->free(_bits, _block_cnt(size)/8); + _bits = nullptr; + } + return 0; }