summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjfhumann <j.f.humann@gmail.com>2014-04-26 01:35:25 +0200
committerjfhumann <j.f.humann@gmail.com>2014-04-26 01:35:25 +0200
commit26568a852e557622ce20fafb08680ccd4d7ad7ac (patch)
treee2b386341b6dde3bd9187c5bba10c93ed8e6c59c
parentFixes resource leaks in the yggdrasil authenticator. (CID 43617) (diff)
downloadcuberite-26568a852e557622ce20fafb08680ccd4d7ad7ac.tar
cuberite-26568a852e557622ce20fafb08680ccd4d7ad7ac.tar.gz
cuberite-26568a852e557622ce20fafb08680ccd4d7ad7ac.tar.bz2
cuberite-26568a852e557622ce20fafb08680ccd4d7ad7ac.tar.lz
cuberite-26568a852e557622ce20fafb08680ccd4d7ad7ac.tar.xz
cuberite-26568a852e557622ce20fafb08680ccd4d7ad7ac.tar.zst
cuberite-26568a852e557622ce20fafb08680ccd4d7ad7ac.zip
-rw-r--r--src/Bindings/ManualBindings.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp
index 92b410481..b3f75aff1 100644
--- a/src/Bindings/ManualBindings.cpp
+++ b/src/Bindings/ManualBindings.cpp
@@ -1750,7 +1750,6 @@ static int tolua_cWorld_ChunkStay(lua_State * tolua_S)
{
return 0;
}
- cLuaChunkStay * ChunkStay = new cLuaChunkStay(*Plugin);
// Read the params:
cWorld * World = (cWorld *)tolua_tousertype(tolua_S, 1, NULL);
@@ -1760,8 +1759,12 @@ static int tolua_cWorld_ChunkStay(lua_State * tolua_S)
L.LogStackTrace();
return 0;
}
+
+ cLuaChunkStay * ChunkStay = new cLuaChunkStay(*Plugin);
+
if (!ChunkStay->AddChunks(2))
{
+ delete ChunkStay;
return 0;
}