aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2010-06-26 22:48:47 +0000
committerFilippos Karapetis2010-06-26 22:48:47 +0000
commite2026f4a26c648482b1823938c2d4a496ed56375 (patch)
treef9483b9b607b88d4bc38d0133a6339727bc18144
parentce111a39df155f379ec829f66a39498bee303720 (diff)
downloadscummvm-rg350-e2026f4a26c648482b1823938c2d4a496ed56375.tar.gz
scummvm-rg350-e2026f4a26c648482b1823938c2d4a496ed56375.tar.bz2
scummvm-rg350-e2026f4a26c648482b1823938c2d4a496ed56375.zip
Zero out the memory pointer of a hunk when freeing it
svn-id: r50351
-rw-r--r--engines/sci/engine/segment.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/engines/sci/engine/segment.h b/engines/sci/engine/segment.h
index 253d94cc53..58f016a654 100644
--- a/engines/sci/engine/segment.h
+++ b/engines/sci/engine/segment.h
@@ -669,7 +669,10 @@ struct HunkTable : public Table<Hunk> {
virtual void freeEntry(int idx) {
Table<Hunk>::freeEntry(idx);
+ if (!_table[idx].mem)
+ warning("Attempt to free an already freed hunk");
free(_table[idx].mem);
+ _table[idx].mem = 0;
}
virtual void saveLoadWithSerializer(Common::Serializer &ser);