From c334bcdfbdfd210afd55ba14a32d0014f571074d Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Sun, 15 Nov 2020 19:40:36 -0600 Subject: Add malloc mem check --- P3/server.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/P3/server.c b/P3/server.c index a285392..6e99330 100644 --- a/P3/server.c +++ b/P3/server.c @@ -219,7 +219,11 @@ int main(int argc, char **argv) { // Initialize cache (extra credit B) cache_entry_t *dynQ; if (cSiz != 0) { + //Should the queue start this large? dynQ = (cache_entry_t*) malloc(cSiz * sizeof(cache_entry_t)); + if (dynQ == NULL) { + printf("malloc cannot allocate the initial requested memory.\n") + } } // Start the server -- cgit v1.2.3