commit | 547ff6618fe75fb04cb5e3deb10163e50d63117c | [log] [tgz] |
---|---|---|
author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | Wed Nov 26 15:42:16 2014 +0100 |
committer | Paul Bakker <p.j.bakker@polarssl.org> | Tue Jan 13 14:58:01 2015 +0100 |
tree | 78d67bce047d08856d91a294e8aca2841a06179e | |
parent | 765bb31d242eaa7106010461503b72170c5fc784 [diff] [blame] |
Fix NULL dereference in buffer-based allocator
diff --git a/library/memory_buffer_alloc.c b/library/memory_buffer_alloc.c index 4f96018..9cae251 100644 --- a/library/memory_buffer_alloc.c +++ b/library/memory_buffer_alloc.c
@@ -484,7 +484,8 @@ if( old == NULL ) { hdr->next_free = heap.first_free; - heap.first_free->prev_free = hdr; + if( heap.first_free != NULL ) + heap.first_free->prev_free = hdr; heap.first_free = hdr; }