Re: [dm-devel] [PATCH] libmultipath: free pgp if add_pathgroup fails in disassemble_map func

2020-07-22 Thread Zhiqiang Liu
Thanks for your review. On 2020/7/23 4:48, Benjamin Marzinski wrote: > On Wed, Jul 22, 2020 at 04:36:04PM +0800, Zhiqiang Liu wrote: >> In disassemble_map func, pgp will be added to mpp->pg by calling >> add_pathgroup after allocing a pathgroup (pgp) successfully. However, >> if add_pathgroup

Re: [dm-devel] [PATCH] libmultipath: free pgp if add_pathgroup fails in disassemble_map func

2020-07-22 Thread Benjamin Marzinski
On Wed, Jul 22, 2020 at 04:36:04PM +0800, Zhiqiang Liu wrote: > In disassemble_map func, pgp will be added to mpp->pg by calling > add_pathgroup after allocing a pathgroup (pgp) successfully. However, > if add_pathgroup fails, the pgp is actually not inserted into mpp->pg. > So, calling

[dm-devel] [PATCH] libmultipath: free pgp if add_pathgroup fails in disassemble_map func

2020-07-22 Thread Zhiqiang Liu
In disassemble_map func, pgp will be added to mpp->pg by calling add_pathgroup after allocing a pathgroup (pgp) successfully. However, if add_pathgroup fails, the pgp is actually not inserted into mpp->pg. So, calling free_pgvec(mpp->pg) cannot free the pgp, then memory leak problem occurs.