summaryrefslogtreecommitdiff
path: root/bsd.cc
diff options
context:
space:
mode:
Diffstat (limited to 'bsd.cc')
-rw-r--r--bsd.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/bsd.cc b/bsd.cc
index 57fb912..8524d5b 100644
--- a/bsd.cc
+++ b/bsd.cc
@@ -134,6 +134,10 @@ int BSDData::ReadBSDData(DiskIO *theDisk, uint64_t startSector, uint64_t endSect
// If the state is good, go ahead and load the main partition data....
if (state == bsd) {
partitions = new struct BSDRecord[numParts * sizeof(struct BSDRecord)];
+ if (partitions == NULL) {
+ cerr << "Unable to allocate memory in BSDData::ReadBSDData()! Terminating!\n";
+ exit(1);
+ } // if
for (i = 0; i < numParts; i++) {
// Once again, we use the buffer, but index it using a BSDRecord
// pointer (dangerous, but effective)....