[U-Boot] [PATCH] dfu: fix possible memory leak in dfu_init_env_entities()

Tom Rini trini at konsulko.com
Mon Nov 23 16:53:56 CET 2015


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 <p.marczak at samsung.com>
> Cc: Lukasz Majewski <l.majewski at samsung.com>

Reviewed-by: Tom Rini <trini at konsulko.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151123/7c02a1ec/attachment.sig>


More information about the U-Boot mailing list