Re: [PATCH 1/5 v4] libmultipath fix a memory leak in set_ble_device

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

 



On Tue, 2020-08-18 at 21:02 +0800, lixiaokeng wrote:
> In set_ble_device func, if blist is NULL or ble is NULL,
> the vendor and product isn't freed. We think it is not
> reasonable that strdup(XXX) is used as set_ble_device
> and store_ble functions' parameter.
> 
> Here we call strdup() in store_ble and set_ble_device
> functions and the string will be free if functions fail.
> Because constant string like "sdb" will be their parameter,
> char * is changed to const char *. This is base on
> upstream-queue branch in openSUSE/multipath-tools.
> 
> The type of ble->vendor_reg is regex_t struct but not a
> pointer, so it can not be set NULL.

Ups. Right. Thanks for correcting me.

> 
> Signed-off-by: Lixiaokeng <lixiaokeng@xxxxxxxxxx>
> Signed-off-by: Zhiqiang Liu <liuzhiqiang26@xxxxxxxxxx>

Reviewed-by: Martin Wilck <mwilck@xxxxxxxx>


--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux