diff options
author | Matt Strapp <strap012@umn.edu> | 2020-11-15 19:40:36 -0600 |
---|---|---|
committer | Matt Strapp <strap012@umn.edu> | 2020-11-15 19:40:36 -0600 |
commit | c334bcdfbdfd210afd55ba14a32d0014f571074d (patch) | |
tree | f2c2e94fae4cbe35c7c0f5137204b8a9a0a29a84 /P3 | |
parent | Change + among many, many other things (diff) | |
download | csci4061-c334bcdfbdfd210afd55ba14a32d0014f571074d.tar csci4061-c334bcdfbdfd210afd55ba14a32d0014f571074d.tar.gz csci4061-c334bcdfbdfd210afd55ba14a32d0014f571074d.tar.bz2 csci4061-c334bcdfbdfd210afd55ba14a32d0014f571074d.tar.lz csci4061-c334bcdfbdfd210afd55ba14a32d0014f571074d.tar.xz csci4061-c334bcdfbdfd210afd55ba14a32d0014f571074d.tar.zst csci4061-c334bcdfbdfd210afd55ba14a32d0014f571074d.zip |
Add malloc mem check
Diffstat (limited to 'P3')
-rw-r--r-- | P3/server.c | 4 |
1 files changed, 4 insertions, 0 deletions
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 |