hotfix: read file memory leak

This commit is contained in:
Michael Thomson 2024-02-12 17:09:04 -05:00
parent f81c911898
commit 6c3feb29c8
No known key found for this signature in database
2 changed files with 4 additions and 1 deletions

BIN
server

Binary file not shown.

View File

@ -143,7 +143,10 @@ char *read_file(char *filename) {
fclose(fp); fclose(fp);
buffer[file_size] = '\0'; buffer[file_size] = '\0';
return buffer; char *value = strdup(buffer);
free(buffer);
return value;
} }
void respond(struct Server *server, int *client_fd) { void respond(struct Server *server, int *client_fd) {