[PATCH] common: Fix memory leak and incorrect comparison

Tom Rini trini at konsulko.com
Tue Feb 11 00:53:55 CET 2025


On Thu, Feb 06, 2025 at 04:48:09PM +0300, Maks Mishin wrote:

> Changing the order of actions: the input argument is checked before 
> memory is allocated. 
> 
> The input argument `n` is of type `size_t` and cannot take 
> negative values, so the comparison has been fixed.
> 
> Signed-off-by: Maks Mishin <maks.mishinFZ at gmail.com>
> ---
>  common/dlmalloc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

This introduces runtime failures:
https://source.denx.de/u-boot/u-boot/-/jobs/1018726

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20250210/3b673a6e/attachment.sig>


More information about the U-Boot mailing list