diff options
-rw-r--r-- | engines/sci/engine/segment.h | 3 |
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); |