summaryrefslogtreecommitdiff
path: root/opentracker.c
diff options
context:
space:
mode:
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