From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id A857D645F1C; Tue, 12 Sep 2023 13:30:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A857D645F1C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1694514657; bh=mATjKgVCqfeTvFyBvvwxO3mz9Se5qDHFW0nQv7oUVNE=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=fqWVTBp+62aGpkLaoEU9F0PKBnnDWpOyfbmhjh73lhf1iIy7dzdbw0geV0847hDhB a7IZaLTXmvUlwKzPeU/23UGG1aDp768FbHonpehhc/G+Glk1TIIU85Usn9jiU7MNE0 EVll1QKqD3AbT9VE18I3SsSG0lbrhzSrluAnGx2I= Received: from smtp44.i.mail.ru (smtp44.i.mail.ru [95.163.41.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id B00325E0EF3 for ; Tue, 12 Sep 2023 13:30:56 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B00325E0EF3 Received: by smtp44.i.mail.ru with esmtpa (envelope-from ) id 1qg0fX-00EEa4-1P; Tue, 12 Sep 2023 13:30:55 +0300 Message-ID: Date: Tue, 12 Sep 2023 13:30:55 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Content-Language: en-US To: Sergey Kaplun Cc: Sergey Bronnikov , tarantool-patches@dev.tarantool.org, max.kokryashkin@gmail.com References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD99D78F05E8BF27CBFC7BA7AA5F3918EDDE87D2087C872B99DCD62213F67905E7AC6A0FE18D7BF78E8CE8CE7426A63C27D670746E67508E436FB652AD2CEFA51F0 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7A8325FA649D0A450EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637D24CDE3D695BBBC6EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BE5CCB53A13BC8DBA9C609003E2DC7F2E96EA43D06F8964EACC7F00164DA146DAFE8445B8C89999728AA50765F7900637D0FEED2715E18529389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC878444BBB7636F62AF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947C632EDEA9CD5989A3C0837EA9F3D197644AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C3BF1F585E929FBCC0BA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CF27ED053E960B195E1DD303D21008E298D5E8D9A59859A8B6957A4DEDD2346B4275ECD9A6C639B01B78DA827A17800CE76C76551EAF50E908731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A51BE63F4D952285BBB32CC128C8E275A3D0C3FCDD67FD83D9F87CCE6106E1FC07E67D4AC08A07B9B082B967D547A19D2FCB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D346C409ABC5F9C579B308A2CA1DF5128A25A91C3ED29FBAC909C429ED63313CD78452A9E26446C3CDE1D7E09C32AA3244C933EA2773FAB73B60DE39AB24CD8263551E887DA02A9F7BFBAD658CF5C8AB4025DA084F8E80FEBD3FFA33E6B6B2F82C47A83BD0C44CE203720ABEDE4BBDD9CDD X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojvAECSnWEGILUY+2e2IGwLA== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A769D138C815ED596B3076105BC46724D9BEBE4EBEF89FC7D6FAEBA65886582A37BD66FEC6BF5C9C28D98A98C1125256619760D574B6FC815AB872D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 2/2][v2] Followup fix for embedded bytecode loader. X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" On 9/11/23 12:26, Sergey Kaplun wrote: >>>> + static const char * >>>> + bc_reader_with_eof(lua_State *L, void *data, size_t *size) >>>> + { >>>> + UNUSED(L); >>>> + dt *test_data = (dt *)data; >>>> + if (test_data->state == EMIT_EOF) { >>>> + *size = 0; >>>> + return NULL; >>>> + } >>>> + >>>> + static char *bc_chunk = NULL; >>>> + free(bc_chunk); >>> This free is called only once, when bc_chunk is already NULL. >>> I suggest moving the initialization of the `bc_chunk` to the beginning >>> of the scope and calling `free()` only for the `EMIT_EOF` state (it's >>> also a little bit more readable -- a reader shouldn't remember that >>> `free(NULL)` is OK). >> Updated. > Unfortunately, I don't see these changes on branch [1]. Force-pushed.