diff options
author | sotech117 <michael_foiani@brown.edu> | 2023-09-21 07:06:14 +0000 |
---|---|---|
committer | sotech117 <michael_foiani@brown.edu> | 2023-09-21 07:06:14 +0000 |
commit | 9ba49f755e152d0996a43e8da7d146b8d2069051 (patch) | |
tree | dde7fe228fc6ab44c3c462576a391193e3189da5 /client.c | |
parent | 433f6eb3a54881913286aa620db93c003c436c16 (diff) |
add timeout
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -170,6 +170,8 @@ void *reply_thread_routine(void* args) { exit(1); } char *song_name = malloc(string_size); + if(song_name == NULL) { perror("malloc in song name"); } + int bytes_to_read = string_size; if (recv_all(sockfd, song_name, &bytes_to_read) == -1) { perror("recv_all"); @@ -186,6 +188,7 @@ void *reply_thread_routine(void* args) { exit(1); } char *message = malloc(string_size); + if(message == NULL) { perror("malloc in message"); } int bytes_to_read = string_size; if (recv_all(sockfd, message, &bytes_to_read) == -1) { perror("recv_all"); |