[ofa-general] [PATCH] osm: fixing memory leak in QoS policy

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Thu Nov 15 03:58:46 PST 2007


Fixing memory leak in QoS policy

Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
---
 opensm/opensm/osm_qos_policy.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/opensm/opensm/osm_qos_policy.c b/opensm/opensm/osm_qos_policy.c
index 6cdf84c..34f72b0 100644
--- a/opensm/opensm/osm_qos_policy.c
+++ b/opensm/opensm/osm_qos_policy.c
@@ -400,6 +400,11 @@ void osm_qos_policy_match_rule_destroy(osm_qos_match_rule_t * p)
 	if (p->qos_class_range_arr)
 		free(p->qos_class_range_arr);

+	for (i = 0; i < p->pkey_range_len; i++)
+		free(p->pkey_range_arr[i]);
+	if (p->pkey_range_arr)
+		free(p->pkey_range_arr);
+
 	cl_list_apply_func(&p->source_list, __free_single_element, NULL);
 	cl_list_remove_all(&p->source_list);
 	cl_list_destroy(&p->source_list);
-- 
1.5.1.4




More information about the general mailing list