Miscellaneous bug fixes.
diff --git a/diskio-windows.cc b/diskio-windows.cc
index 938d7ec..37e5bb5 100644
--- a/diskio-windows.cc
+++ b/diskio-windows.cc
@@ -230,7 +230,11 @@
             numBlocks++;
          tempSpace = new char [numBlocks * blockSize];
       } // if/else
-
+      if (tempSpace == NULL) {
+         cerr << "Unable to allocate memory in DiskIO::Read()! Terminating!\n";
+         exit(1);
+      } // if
+      
       // Read the data into temporary space, then copy it to buffer
       ReadFile(fd, tempSpace, numBlocks * blockSize, &retval, NULL);
       for (i = 0; i < numBytes; i++) {
@@ -271,6 +275,10 @@
          if ((numBytes % blockSize) != 0) numBlocks++;
          tempSpace = new char [numBlocks * blockSize];
       } // if/else
+      if (tempSpace == NULL) {
+         cerr << "Unable to allocate memory in DiskIO::Write()! Terminating!\n";
+         exit(1);
+      } // if
 
       // Copy the data to my own buffer, then write it
       for (i = 0; i < numBytes; i++) {