From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Fri, 14 Apr 2017 17:09:27 -0400 Subject: [U-Boot] [U-Boot, v1, 4/4] env: fix memory leak in fw_env routines In-Reply-To: <1491408483-13228-5-git-send-email-sbabic@denx.de> References: <1491408483-13228-5-git-send-email-sbabic@denx.de> Message-ID: <20170414210927.GE19897@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, Apr 05, 2017 at 06:08:03PM +0200, Stefano Babic wrote: > fw_env_open allocates buffers to store the environment, but these > buffers are never freed. This becomes quite nasty using the fw_ tools as > library, because each access to the environment (even just reading a > variable) generates a memory leak equal to the size of the environment. > > Fix this renaming fw_env_close() as fw_env_flush(), because the function > really flushes the environment from RAM to storage, and add a > fw_env_close function to free the allocated resources. > > Signed-off-by: Stefano Babic Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: