From 6b0069ba013236a74be22b30229162b6bfb917b2 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Tue, 27 Oct 2026 20:17:12 +0100 Subject: Turn malloc+memset into calloc --- opentracker.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'opentracker.c') diff --git a/opentracker.c b/opentracker.c index 065a1ea..eb97b42 100644 --- a/opentracker.c +++ b/opentracker.c @@ -217,11 +217,10 @@ static void handle_accept(const int64_t serversocket) { socket_set_blocking((int)sock, 0); - if (!(cookie = (struct http_data *)malloc(sizeof(struct http_data)))) { + if (!(cookie = (struct http_data *)calloc(1, sizeof(struct http_data)))) { close((int)sock); continue; } - memset(cookie, 0, sizeof(struct http_data)); memcpy(cookie->ip, ip, sizeof(ot_ip6)); cookie->interest = EVENT_IN; -- cgit v1.3