From: Tom Rini Date: Mon, 23 Nov 2015 10:53:56 -0500 Subject: [U-Boot] [PATCH] dfu: fix possible memory leak in dfu_init_env_entities() In-Reply-To: <1448292214-10787-1-git-send-email-p.marczak@samsung.com> References: <1448292214-10787-1-git-send-email-p.marczak@samsung.com> Message-ID: <20151123155356.GM9551@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 Mon, Nov 23, 2015 at 04:23:34PM +0100, Przemyslaw Marczak wrote: > The string of environment variable $dfu_alt_info is duplicated > by strdup() before parsing its content. The memory leak occurs, > when dfu fails, because the duplicated variable is freed only > on command success. > > This simple fix allows calling free() always before the return. > > Signed-off-by: Przemyslaw Marczak > Cc: Lukasz Majewski Reviewed-by: Tom Rini -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: