From af68e813ad9e413421ba2dcce14093f186130082 Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Wed, 18 Nov 2020 11:56:36 -0600 Subject: aaaaaaaaaaaaaaaaaaaaaaaaa --- P3/server.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/P3/server.c b/P3/server.c index 899c23e..a8667d2 100644 --- a/P3/server.c +++ b/P3/server.c @@ -370,10 +370,8 @@ void *worker(void *arg) } else { - char *value = (char *)malloc(numbytes * sizeof(char)); - strcpy(value, workerBuf) //Not in cache, disk read succeeds - addIntoCache(request->request, value, (int)numbytes); + addIntoCache(request->request, workerBuf, (int)numbytes); } } } @@ -386,7 +384,6 @@ void *worker(void *arg) fclose(log); pthread_mutex_unlock(&logLock); free(bytesError); - free(workerBuf); // Return the result if (fail) -- cgit v1.2.3