We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 273726b commit ae7ce87Copy full SHA for ae7ce87
main.c
@@ -95,8 +95,7 @@ struct state {
95
96
static void state_add_socket_fd(struct state *state, int socket_fd) {
97
dispatch_semaphore_wait(state->sem, DISPATCH_TIME_FOREVER);
98
- struct conn *conn = malloc(sizeof(struct conn));
99
- memset(conn, 0, sizeof(*conn));
+ struct conn *conn = calloc(1, sizeof(*conn));
100
conn->socket_fd = socket_fd;
101
if (state->conns == NULL) {
102
state->conns = conn;
0 commit comments