From 24fe879cbf6812bd0dfe97c185e633f60ed92db9 Mon Sep 17 00:00:00 2001 From: Lode Vandevenne Date: Thu, 21 Apr 2016 12:43:17 +0200 Subject: Update lodepng.cpp --- lodepng.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lodepng.cpp b/lodepng.cpp index 08d1bfb..0e9962d 100644 --- a/lodepng.cpp +++ b/lodepng.cpp @@ -730,7 +730,7 @@ static BPMNode* bpmnode_create(BPMLists* lists, int weight, unsigned index, BPMN /*sort the leaves with stable mergesort*/ static void bpmnode_sort(BPMNode* leaves, size_t num) { - BPMNode* mem = (BPMNode*)malloc(sizeof(*leaves) * num); + BPMNode* mem = (BPMNode*)lodepng_malloc(sizeof(*leaves) * num); size_t width, counter = 0; for(width = 1; width < num; width *= 2) { @@ -751,7 +751,7 @@ static void bpmnode_sort(BPMNode* leaves, size_t num) counter++; } if(counter & 1) memcpy(leaves, mem, sizeof(*leaves) * num); - free(mem); + lodepng_free(mem); } /*Boundary Package Merge step, numpresent is the amount of leaves, and c is the current chain.*/ -- cgit v1.2.3