From c49e29f8b94877a6de9b32b45091f53d4b3364a6 Mon Sep 17 00:00:00 2001 From: Michael Balzer Date: Sat, 2 Jun 2018 13:43:04 +0200 Subject: [PATCH] Fix crash on realloc of block with size 0 --- components/heap/heap_caps.c | 1 - 1 file changed, 1 deletion(-) diff --git a/components/heap/heap_caps.c b/components/heap/heap_caps.c index ad971c176..ade724125 100644 --- a/components/heap/heap_caps.c +++ b/components/heap/heap_caps.c @@ -295,7 +295,6 @@ IRAM_ATTR void *heap_caps_realloc( void *ptr, size_t size, int caps) void *new_p = heap_caps_malloc(size, caps); if (new_p != NULL) { size_t old_size = multi_heap_get_allocated_size(heap->heap, ptr); - assert(old_size > 0); memcpy(new_p, ptr, MIN(size, old_size)); heap_caps_free(ptr); return new_p;