Fix a memleak before assertion in l_get_mod_storage
authorLoic Blot <loic.blot@unix-experience.fr>
Sat, 30 Jun 2018 08:32:02 +0000 (10:32 +0200)
committerLoic Blot <loic.blot@unix-experience.fr>
Sat, 30 Jun 2018 08:32:02 +0000 (10:32 +0200)
src/script/lua_api/l_storage.cpp

index 280ec7266f6a55ba04dc75ef04570814c5d1d0c2..2a2b35a31e10ec1aae90b0403afe1e30de2886d0 100644 (file)
@@ -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
        }