[dm-devel] [PATCH V3] libmultipath: fix a memory leak in set_ble_device

Martin Wilck mwilck at suse.com
Thu Aug 13 11:40:23 UTC 2020


On Thu, 2020-08-13 at 14:40 +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.
> 
> Signed-off-by: Lixiaokeng <lixiaokeng at huawei.com>
> Signed-off-by: Zhiqiang Liu <liuzhiqiang26 at huawei.com>

Thank you.

Reviewed-by: Martin Wilck <mwilck at suse.com>






More information about the dm-devel mailing list