Re: [dm-devel] [PATCH v2] libmultipath: fix memory leaks in coalesce_paths

2020-11-01 Thread lixiaokeng
On 2020/11/2 5:23, Martin Wilck wrote: > Previously, this code, which flushes maps that aren't valid any more, > would only be called from multipathd() -> reconfigure(), because in all > other cases newmp was NULL. > > AFAICS, you will now call dm_flush_map() even if called with > newmp==NULL (

Re: [dm-devel] [PATCH v2] libmultipath: fix memory leaks in coalesce_paths

2020-11-01 Thread Martin Wilck
Hi lixiaokeng, On Thu, 2020-10-22 at 15:28 +0800, lixiaokeng wrote: > When multipath -F are executed first and multipath -v2 or > -d are executed later, asan will warn memory leaks. The > reason is that the mpp allocated in coalesce_paths isn't > freed. Here we use newmp to store mpp. If newmp nee

[dm-devel] [PATCH v2] libmultipath: fix memory leaks in coalesce_paths

2020-10-22 Thread lixiaokeng
When multipath -F are executed first and multipath -v2 or -d are executed later, asan will warn memory leaks. The reason is that the mpp allocated in coalesce_paths isn't freed. Here we use newmp to store mpp. If newmp need not be copied to mpvec, we free newmp at the end of the func. Signed-off-b