aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Strapp <strap012@umn.edu>2020-11-15 19:40:36 -0600
committerMatt Strapp <strap012@umn.edu>2020-11-15 19:40:36 -0600
commitc334bcdfbdfd210afd55ba14a32d0014f571074d (patch)
treef2c2e94fae4cbe35c7c0f5137204b8a9a0a29a84
parentChange + among many, many other things (diff)
downloadcsci4061-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
-rw-r--r--P3/server.c4
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