From 4cdee0ee4745a5bb44b9f2c95812cb4f1aea0a31 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 8 Mar 2012 23:20:35 +0100 Subject: Fix allocated buffer size in fastd_buffer_alloc() --- src/fastd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/fastd.h') 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 }; } -- cgit v1.2.3