Question: Why segmentation fault?
#include <arpa/inet.h>
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <unistd.h>

#include "helper.c"

#ifndef PORT
#define PORT 53655
#endif
#define MAX_BACKLOG 5
#define MAX_CONNECTIONS 12
#define BUF_SIZE 128

typedef struct client {
    int client_fd;
    char *client_username;
    char partial_read[BUF_SIZE];
    struct client *next;
} Client;

int accept_connection(int fd, Client *client_linked_list) {
    int client_fd = accept(fd, NULL, NULL);
    if (client_fd < 0) {
        perror("server: accept");
        close(fd);
        exit(1);
    }

    Client *curr_node = client_linked_list;
    if (curr_node == NULL) {
        client_linked_list = malloc(sizeof(Client));
        client_linked_list->client_fd = client_fd;
        client_linked_list->client_username = NULL;
    } else {
        while (curr_node->next != NULL) {
            if (curr_node->next->client_fd != -1) {
                break;
            }
            curr_node = curr_node->next;
        }
        Client *new_node = malloc(sizeof(Client));
        new_node->client_fd = client_fd;
        new_node->client_username = NULL;
        curr_node->next = new_node;
    }
    return client_fd;
}

int read_from(Client *curr_client, User *user_list) {
    int fd = curr_client->client_fd;
    char buf[BUF_SIZE + 1];
    int num_read = read(fd, &buf, BUF_SIZE);
    buf[num_read] = '\0';

    char *new_message = helper(buf, curr_client->client_username, user_list);
    if (num_read == 0 || write(fd, new_message, strlen(new_message)) != strlen(new_message)) {
        curr_client->client_fd = -1;
        return fd;
    }

    return 0;
}
