fix cxBufferMinimumCapacity not using the allocator

Sun, 24 Apr 2022 17:44:52 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 24 Apr 2022 17:44:52 +0200
changeset 534
0e893f84a7dd
parent 533
8d70ad8da899
child 535
2ff6e9184468

fix cxBufferMinimumCapacity not using the allocator

src/buffer.c file | annotate | diff | comparison | revisions
--- a/src/buffer.c	Sun Apr 24 17:29:34 2022 +0200
+++ b/src/buffer.c	Sun Apr 24 17:44:52 2022 +0200
@@ -119,9 +119,7 @@
         return 0;
     }
 
-    unsigned char *newspace = realloc(buffer->bytes, newcap);
-    if (newspace) {
-        buffer->bytes = newspace;
+    if (cxReallocate(buffer->allocator, &buffer->bytes, newcap) == 0) {
         buffer->capacity = newcap;
         return 0;
     } else {

mercurial