From 9d0b0523cf119fdc400bf477c2f9d6f4f37ddce6 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sun, 10 Aug 2008 18:44:00 +0000 Subject: Fixed a bunch of Valgrind warnings (mostly uninitialised variables, but also an invalid free()), so that I can start and quit the game without any unexpected warnings. (The obvious next step, of course, would be to actually *play* the game for a bit...) svn-id: r33766 --- engines/drascula/drascula.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index e8e4ea94b9..2d24978f21 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -162,6 +162,12 @@ int DrasculaEngine::init() { _textmisc = 0; _textd1 = 0; + _color = 0; + blinking = 0; + leftMouseButton = 0; + rightMouseButton = 0; + *textName = 0; + if (!loadDrasculaDat()) return 1; @@ -1020,7 +1026,7 @@ void DrasculaEngine::freeTexts(char ***ptr) { for (int lang = 0; lang < _numLangs; lang++) { if (ptr[lang]) { - free(ptr[lang][0] - DATAALIGNMENT); + free(ptr[lang][0]); free(ptr[lang]); } } -- cgit v1.2.3