about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libhttpc.c7
-rw-r--r--src/malloc.c5
-rw-r--r--src/request.c4
3 files changed, 9 insertions, 7 deletions
diff --git a/src/libhttpc.c b/src/libhttpc.c
index 2f700b2..5a39210 100644
--- a/src/libhttpc.c
+++ b/src/libhttpc.c
@@ -1,8 +1,9 @@
 #include "libhttpc.h"
 
 
-void LibHTTPC(LibHTTPC_Malloc *malloc, LibHTTPC_Realloc *realloc)
+void LibHTTPC(LibHTTPC_Malloc *malloc, LibHTTPC_Realloc *realloc, LibHTTPC_Free *free)
 {
-    LibHTTPC_malloc = malloc;
-    LibHTTPC_realloc = realloc;
+    LibHTTPC_malloc     = malloc;
+    LibHTTPC_realloc    = realloc;
+    LibHTTPC_free       = free;
 }
diff --git a/src/malloc.c b/src/malloc.c
index a654e31..6287e4a 100644
--- a/src/malloc.c
+++ b/src/malloc.c
@@ -1,5 +1,6 @@
 #include "libhttpc.h"
 
 
-LibHTTPC_Malloc *LibHTTPC_malloc = NULL;
-LibHTTPC_Realloc *LibHTTPC_realloc = NULL;
+LibHTTPC_Malloc    *LibHTTPC_malloc     = NULL;
+LibHTTPC_Realloc   *LibHTTPC_realloc    = NULL;
+LibHTTPC_Free      *LibHTTPC_free       = NULL;
diff --git a/src/request.c b/src/request.c
index 3e017b7..56bf47b 100644
--- a/src/request.c
+++ b/src/request.c
@@ -74,7 +74,7 @@ struct LibHTTPC_Request *LibHTTPC_loadRequest(struct LibHTTPC_Request *request_b
 void LibHTTPC_Request_(struct LibHTTPC_Request *request)
 {
     if (request->header_selfalloc)
-        free(request->headers);
+        LibHTTPC_free(request->headers);
     if (request->selfalloc)
-        free(request);
+        LibHTTPC_free(request);
 }