diff options
author | truebrain <truebrain@openttd.org> | 2009-01-17 14:54:24 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2009-01-17 14:54:24 +0000 |
commit | fe900776814d098dbb5799bf4ab387ea072277b6 (patch) | |
tree | d6b79724651cef87fc2edd5fc068f6100c053697 /src/ai/ai_info.cpp | |
parent | 2cc217cabf862e2133735c70c74e0d533197e739 (diff) | |
download | openttd-fe900776814d098dbb5799bf4ab387ea072277b6.tar.xz |
(svn r15120) -Fix: more mem-leak fixes
Diffstat (limited to 'src/ai/ai_info.cpp')
-rw-r--r-- | src/ai/ai_info.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ai/ai_info.cpp b/src/ai/ai_info.cpp index 9528f32cd..60503f7dd 100644 --- a/src/ai/ai_info.cpp +++ b/src/ai/ai_info.cpp @@ -359,7 +359,10 @@ int AIInfo::GetSettingDefaultValue(const char *name) AILibrary *library = new AILibrary(); SQInteger res = AIFileInfo::Constructor(vm, library, true); - if (res != 0) return res; + if (res != 0) { + delete library; + return res; + } /* Register the Library to the base system */ library->base->RegisterLibrary(library); |