Re: [PATCH v3] bpftool: Fix memory leak in dump_xx_nlmsg on realloc failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2025-06-20 09:21 UTC+0800 ~ Yuan Chen <chenyuan_fl@xxxxxxx>
> From: Yuan Chen <chenyuan@xxxxxxxxxx>
> 
> In function dump_xx_nlmsg(), when realloc() fails to allocate memory,
> the original pointer to the buffer is overwritten with NULL. This causes
> a memory leak because the previously allocated buffer becomes unreachable
> without being freed.
> 
> Fixes: 7900efc19214 ("tools/bpf: bpftool: improve output format for bpftool net")
> Signed-off-by: Yuan Chen <chenyuan@xxxxxxxxxx>

Reviewed-by: Quentin Monnet <qmo@xxxxxxxxxx>

Thanks!




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux