summaryrefslogtreecommitdiff
path: root/bsd.cc
diff options
context:
space:
mode:
authorsrs5694 <srs5694@users.sourceforge.net>2011-06-10 01:16:51 -0400
committersrs5694 <srs5694@users.sourceforge.net>2011-06-10 01:16:51 -0400
commit6aae2a9b70e9f88926baad94c1eea40e0b534f01 (patch)
tree1e6d2e25970f415091b8f6518eb1f6d8e0988847 /bsd.cc
parent699941e25a1fcf0beec124203747c8ed20842989 (diff)
downloadsgdisk-6aae2a9b70e9f88926baad94c1eea40e0b534f01.tar.gz
Miscellaneous bug fixes.
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)....