summaryrefslogtreecommitdiff
path: root/opentracker.c
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2026-10-27 20:17:12 +0100
committerDirk Engling <erdgeist@erdgeist.org>2026-10-27 20:17:12 +0100
commit6b0069ba013236a74be22b30229162b6bfb917b2 (patch)
treed4845be0a07449de05cbffe9bd84b9d68d98f352 /opentracker.c
parente66be92eed36e53fd35d277959ada176933f619d (diff)
Turn malloc+memset into calloc
Diffstat (limited to 'opentracker.c')
-rw-r--r--opentracker.c3
1 files changed, 1 insertions, 2 deletions
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) {
217 217
218 socket_set_blocking((int)sock, 0); 218 socket_set_blocking((int)sock, 0);
219 219
220 if (!(cookie = (struct http_data *)malloc(sizeof(struct http_data)))) { 220 if (!(cookie = (struct http_data *)calloc(1, sizeof(struct http_data)))) {
221 close((int)sock); 221 close((int)sock);
222 continue; 222 continue;
223 } 223 }
224 memset(cookie, 0, sizeof(struct http_data));
225 memcpy(cookie->ip, ip, sizeof(ot_ip6)); 224 memcpy(cookie->ip, ip, sizeof(ot_ip6));
226 cookie->interest = EVENT_IN; 225 cookie->interest = EVENT_IN;
227 226