From b2923578129845c2c66a37641e6c02567a7c379c Mon Sep 17 00:00:00 2001
From: Pompolic <pompolic@special-circumstanc.es>
Date: Mon, 29 Nov 2021 15:34:47 +0100
Subject: [PATCH] One more malloc->calloc change

---
 lzw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lzw.c b/lzw.c
index 3bd991d..9d0159a 100644
--- a/lzw.c
+++ b/lzw.c
@@ -367,7 +367,7 @@ act_LZW_data(const HParseResult *p, void *u)
 
 	total_buffer_size = first.len + rest.len;
 
-	buffer = malloc(sizeof(uint8_t) * total_buffer_size); // XXX arena alloc, calloc
+	buffer = calloc(total_buffer_size, sizeof(uint8_t));
 	memcpy(buffer, first.token, first.len);
 	memcpy(buffer+first.len, rest.token, rest.len);
 	// XXX: Memory use would be greatly decreased if first.token and rest.token could be freed here (allocated in act_LZW_firstcode and act_LZW_body)
-- 
GitLab