Re: [PATCH 1/5] osmt_service.c: fix resource leak in osmt_get_all_services_and_check_names

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

 



On 8/27/2018 9:48 PM, Honggang LI wrote:
> From: Honggang Li <honli@xxxxxxxxxx>
> 
> Issue was found by Coverity.
> 
> Error: RESOURCE_LEAK (CWE-772): [#def12]
> opensm-3.3.20/osmtest/osmt_service.c:988: alloc_fn: Storage is returned from allocation function "malloc".
> opensm-3.3.20/osmtest/osmt_service.c:988: var_assign: Assigning: "p_checked_names" = storage returned from "malloc(1UL * num_of_valid_names)".
> opensm-3.3.20/osmtest/osmt_service.c:1091: leaked_storage: Variable "p_checked_names" going out of scope leaks the storage it points to.
> |# 1089|
> |# 1090|   	OSM_LOG_EXIT(&p_osmt->log);
> |# 1091|-> 	return status;
> |# 1092|   }
> |# 1093|   #endif
> 
> Signed-off-by: Honggang Li <honli@xxxxxxxxxx>

Thanks. Applied.

-- Hal



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux