]> granicus.if.org Git - jq/commitdiff
exec_stack.h was not using jv_mem_realloc()
authorNicolas Williams <nico@cryptonector.com>
Mon, 23 Dec 2013 23:13:19 +0000 (17:13 -0600)
committerNicolas Williams <nico@cryptonector.com>
Tue, 8 Jul 2014 00:33:19 +0000 (19:33 -0500)
exec_stack.h

index 95fca7137df734f91f9480cbf6a45b242077e8d4..ce4ab83c4191410fc53e8456d858140733e40974 100644 (file)
@@ -4,6 +4,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
+#include "jv_alloc.h"
 
 struct determine_alignment {
   char x;
@@ -53,7 +54,7 @@ static void stack_reallocate(struct stack* s, size_t sz) {
   char* old_mem_start = s->mem_end - old_mem_length;
   
   int new_mem_length = align_round_up((old_mem_length + sz + 256) * 2);
-  char* new_mem_start = realloc(old_mem_start, new_mem_length);
+  char* new_mem_start = jv_mem_realloc(old_mem_start, new_mem_length);
   memmove(new_mem_start + (new_mem_length - old_mem_length),
             new_mem_start, old_mem_length);
   s->mem_end = new_mem_start + new_mem_length;