summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/fastd.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fastd.h b/src/fastd.h
index fa0fa98..806beb7 100644
--- a/src/fastd.h
+++ b/src/fastd.h
@@ -140,7 +140,7 @@ void fastd_printf(const fastd_context *ctx, const char *format, ...);
static inline fastd_buffer fastd_buffer_alloc(size_t len, size_t head_space, size_t tail_space) {
size_t base_len = head_space+len+tail_space;
- uint8_t *ptr = malloc(head_space+len);
+ uint8_t *ptr = malloc(base_len);
return (fastd_buffer){ .base = ptr, .base_len = base_len, .data = ptr+head_space, .len = len };
}