diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-01-26 15:02:15 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-01-26 15:02:15 +0100 |
| commit | a1f2467a87f5ce6b0841b2f0d9dc80a26b689147 (patch) | |
| tree | 56a653dbabea84c8dda9c2259dc9ddd554cbf001 /src | |
| parent | f4f436870f9ce0368d81c504e93b012e3928a851 (diff) | |
Debug and new tests:
- Fix HalfMove memory leak
- Fix integer overflow
- Update combined tests
Diffstat (limited to 'src')
| -rw-r--r-- | src/HalfMove.cpp | 1 | ||||
| -rw-r--r-- | src/PGN.cpp | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/HalfMove.cpp b/src/HalfMove.cpp index 7e94ef9..7cf3f64 100644 --- a/src/HalfMove.cpp +++ b/src/HalfMove.cpp @@ -5,6 +5,7 @@ namespace pgnp { HalfMove::HalfMove() : count(-1), isBlack(false), MainLine(NULL) {} HalfMove::~HalfMove() { + delete MainLine; for (auto *move : variations) { delete move; } diff --git a/src/PGN.cpp b/src/PGN.cpp index aac5614..79d599d 100644 --- a/src/PGN.cpp +++ b/src/PGN.cpp @@ -45,7 +45,7 @@ void PGN::ParseNextGame() { if (IS_EOF) { throw NoGameFound(); } - int loc = NextNonBlank(LastGameEndLoc); + long loc = NextNonBlank(LastGameEndLoc); if (IS_EOF) { throw NoGameFound(); } |
