Re: [dm-devel] [PATCH v3 1/3] libmultipath: prevent memory leak in alloc_path_with_pathinfo() if pp_ptr is NULL

2016-12-13 Thread Hannes Reinecke
On 12/14/2016 03:01 AM, Mauricio Faria de Oliveira wrote: In alloc_path_with_pathinfo(), if the 'pp_ptr' argument is NULL (which is acceptable and checked in the function in two places) the 'pp' pointer is lost as it is not referenced anywhere else; thus the memory allocated for it is leaked. So

[dm-devel] [PATCH v3 1/3] libmultipath: prevent memory leak in alloc_path_with_pathinfo() if pp_ptr is NULL

2016-12-13 Thread Mauricio Faria de Oliveira
In alloc_path_with_pathinfo(), if the 'pp_ptr' argument is NULL (which is acceptable and checked in the function in two places) the 'pp' pointer is lost as it is not referenced anywhere else; thus the memory allocated for it is leaked. So, call free_path() in the case 'pp_ptr' is NULL too. Signed