Re: [PATCH 4/5] osm_qos_parser_y.y: fix resource leak

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

 



On 8/27/2018 2:42 AM, Honggang LI wrote:
> From: Honggang Li <honli@xxxxxxxxxx>
> 
> Issue was found by Coverity.
> 
> Error: RESOURCE_LEAK (CWE-772): [#def11]
> opensm-3.3.20/opensm/osm_qos_parser_y.y:996: alloc_fn: Storage is returned from allocation function "malloc".
> opensm-3.3.20/opensm/osm_qos_parser_y.y:996: var_assign: Assigning: "range_arr" = storage returned from "malloc(8UL)".
> opensm-3.3.20/opensm/osm_qos_parser_y.y:1006: noescape: Resource "range_arr" is not freed or pointed-to in "__validate_pkeys".
> opensm-3.3.20/opensm/osm_qos_parser_y.y:3111:42: noescape: "__validate_pkeys(uint64_t **, unsigned int, boolean_t)" does not free or save its parameter "range_arr".
> opensm-3.3.20/opensm/osm_qos_parser_y.y:1007: leaked_storage: Variable "range_arr" going out of scope leaks the storage it points to.
> |# 1005|                            */
> |# 1006|                           if (__validate_pkeys(range_arr, 1, TRUE))
> |# 1007|->                             return 1;
> |# 1008|
> |# 1009|                           p_current_qos_match_rule->pkey_range_arr = range_arr;
> 
> 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