aboutsummaryrefslogtreecommitdiff
path: root/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'client.c')
-rw-r--r--client.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/client.c b/client.c
index 852e7ff..760b494 100644
--- a/client.c
+++ b/client.c
@@ -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");