aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api
diff options
context:
space:
mode:
authorJosiahWI <41302989+JosiahWI@users.noreply.github.com>2022-06-26 08:37:50 -0500
committerGitHub <noreply@github.com>2022-06-26 14:37:50 +0100
commit4163c872af4fd75ea48b4acfe81888450e0749e6 (patch)
tree796a000687eef987e00e58f02eb5d83e341ba667 /src/script/lua_api
parent4b087a0de2e46ba32b79084602356d7e0221637f (diff)
downloadminetest-4163c872af4fd75ea48b4acfe81888450e0749e6.tar.gz
minetest-4163c872af4fd75ea48b4acfe81888450e0749e6.tar.bz2
minetest-4163c872af4fd75ea48b4acfe81888450e0749e6.zip
Fix two memleak reports from Coverity (#12466)
Diffstat (limited to 'src/script/lua_api')
-rw-r--r--src/script/lua_api/l_env.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/script/lua_api/l_env.cpp b/src/script/lua_api/l_env.cpp
index ee49fd6bd..b26c89e7d 100644
--- a/src/script/lua_api/l_env.cpp
+++ b/src/script/lua_api/l_env.cpp
@@ -1219,7 +1219,8 @@ int ModApiEnvMod::l_emerge_area(lua_State *L)
sortBoxVerticies(bpmin, bpmax);
size_t num_blocks = VoxelArea(bpmin, bpmax).getVolume();
- assert(num_blocks != 0);
+ if (num_blocks == 0)
+ return 0;
if (lua_isfunction(L, 3)) {
callback = LuaEmergeAreaCallback;