From 4163c872af4fd75ea48b4acfe81888450e0749e6 Mon Sep 17 00:00:00 2001 From: JosiahWI <41302989+JosiahWI@users.noreply.github.com> Date: Sun, 26 Jun 2022 08:37:50 -0500 Subject: Fix two memleak reports from Coverity (#12466) --- src/script/lua_api/l_env.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/script/lua_api') 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; -- cgit v1.2.3