From: Loic Blot Date: Sat, 30 Jun 2018 08:32:02 +0000 (+0200) Subject: Fix a memleak before assertion in l_get_mod_storage X-Git-Tag: 5.0.0~326 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d7f873bc8d8edc73cee1c40db055b038febc4e1b;p=oweals%2Fminetest.git Fix a memleak before assertion in l_get_mod_storage --- diff --git a/src/script/lua_api/l_storage.cpp b/src/script/lua_api/l_storage.cpp index 280ec7266..2a2b35a31 100644 --- a/src/script/lua_api/l_storage.cpp +++ b/src/script/lua_api/l_storage.cpp @@ -37,6 +37,7 @@ int ModApiStorage::l_get_mod_storage(lua_State *L) store->load(gamedef->getModStoragePath()); gamedef->registerModStorage(store); } else { + delete store; assert(false); // this should not happen }