aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-10-03 17:38:09 +0200
committerlonkaars <loek@pipeframe.xyz>2022-10-03 17:38:09 +0200
commit686e8a3bb7fc371d300aee357be6f24a5c77bee2 (patch)
tree167f6f40443acb77e14372ee1f75d24b0a617773
parent49c81f56b9262a41335f36a727c8125e349b1487 (diff)
fix segfault due to uninitialized member variable
-rw-r--r--week-6/PuntContainer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/week-6/PuntContainer.cpp b/week-6/PuntContainer.cpp
index 59b5fd7..e673472 100644
--- a/week-6/PuntContainer.cpp
+++ b/week-6/PuntContainer.cpp
@@ -1,3 +1,5 @@
+#include <memory>
+
#include "PuntContainer.h"
#include "Punt.h"
@@ -27,6 +29,7 @@ int PuntContainer::checkZ2(const Punt& punt1, const Punt& punt2) const {
PuntContainer::PuntContainer() {
this->puntRij = (Punt*) malloc(sizeof(Punt) * 10);
+ this->grootte = 0;
}
PuntContainer::~PuntContainer() {