From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 28 Jan 2019 21:17:16 +0300 From: Alexander Turenko Subject: Re: [PATCH v2 2/6] Add functions to ease using Lua iterators from C Message-ID: <20190128181716.rqcz4ydjs2krm2hr@tkn_work_nb> References: <2c8049118f86934d6088636dba44f92f381ef8ff.1547064388.git.alexander.turenko@tarantool.org> <20190110122909.novsa6o6duykot6a@esperanza> <20190115232623.huxpqj4adoqqi3mo@tkn_work_nb> <20190116081802.wpnbjaagm7qftlnb@esperanza> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190116081802.wpnbjaagm7qftlnb@esperanza> To: Vladimir Davydov Cc: tarantool-patches@freelists.org List-ID: Updated a bit: diff --git a/src/lua/utils.c b/src/lua/utils.c index 173d59a59..c8cfa70b3 100644 --- a/src/lua/utils.c +++ b/src/lua/utils.c @@ -981,6 +981,11 @@ struct luaL_iterator * luaL_iterator_new(lua_State *L, int idx) { struct luaL_iterator *it = malloc(sizeof(struct luaL_iterator)); + if (it == NULL) { + diag_set(OutOfMemory, sizeof(struct luaL_iterator), + "malloc", "luaL_iterator"); + return NULL; + } if (idx == 0) { /* gen, param, state are on top of a Lua stack. */