diff options
author | Eugene Sandulenko | 2008-08-02 21:05:46 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2008-08-02 21:05:46 +0000 |
commit | 4d10465cdf91c7381449e0120adc183dd2e4ca05 (patch) | |
tree | 0cb11fb4539b5b942d1d80291a2c1835d760af31 | |
parent | efd4a7a72f6e44fc18be1827c92dcbbb59b5beb2 (diff) | |
download | scummvm-rg350-4d10465cdf91c7381449e0120adc183dd2e4ca05.tar.gz scummvm-rg350-4d10465cdf91c7381449e0120adc183dd2e4ca05.tar.bz2 scummvm-rg350-4d10465cdf91c7381449e0120adc183dd2e4ca05.zip |
Fix crash when drascula.dat file is missing
svn-id: r33537
-rw-r--r-- | engines/drascula/drascula.cpp | 9 |
1 files 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); } |