diff options
author | Eugene Sandulenko | 2008-06-09 14:45:45 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2008-06-09 14:45:45 +0000 |
commit | 50c62c7eac52dbb8beb6e3381a1312be45c43835 (patch) | |
tree | bfcf32205cec5bf3943a6fb300fcf682797d4bed /engines/drascula | |
parent | 661e507772f4f5aadb9fe35468cc105e4232a8bc (diff) | |
download | scummvm-rg350-50c62c7eac52dbb8beb6e3381a1312be45c43835.tar.gz scummvm-rg350-50c62c7eac52dbb8beb6e3381a1312be45c43835.tar.bz2 scummvm-rg350-50c62c7eac52dbb8beb6e3381a1312be45c43835.zip |
Properly initialize and free memory for texts
svn-id: r32636
Diffstat (limited to 'engines/drascula')
-rw-r--r-- | engines/drascula/drascula.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index 65a8c4d2f3..0085383ac1 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -957,8 +957,8 @@ char ***DrasculaEngine::loadTexts(Common::File &in) { res[lang] = (char **)malloc(sizeof(char *) * numTexts); - res[lang][0] = pos = (char *)malloc(entryLen); - res[lang][0] = pos = pos + DATAALIGNMENT; + pos = (char *)malloc(entryLen); + res[lang][0] = pos + DATAALIGNMENT; in.read(res[lang][0], entryLen); @@ -979,7 +979,7 @@ char ***DrasculaEngine::loadTexts(Common::File &in) { void DrasculaEngine::freeTexts(char ***ptr) { for (int lang = 0; lang < _numLangs; lang++) { - free(ptr[lang][0]); + free(ptr[lang][0] - DATAALIGNMENT); free(ptr[lang]); } free(ptr); |