From 4d10465cdf91c7381449e0120adc183dd2e4ca05 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 2 Aug 2008 21:05:46 +0000 Subject: Fix crash when drascula.dat file is missing svn-id: r33537 --- engines/drascula/drascula.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index 1cbe2ae0e1..f25c24ed58 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -987,9 +987,14 @@ char ***DrasculaEngine::loadTexts(Common::File &in) { } void DrasculaEngine::freeTexts(char ***ptr) { + if (!ptr) + return; + for (int lang = 0; lang < _numLangs; lang++) { - free(ptr[lang][0] - DATAALIGNMENT); - free(ptr[lang]); + if (ptr[lang]) { + free(ptr[lang][0] - DATAALIGNMENT); + free(ptr[lang]); + } } free(ptr); } -- cgit v1.2.3