[ofa-general] [PATCH ]

Slava Strebkov slavas at voltaire.com
Tue Dec 16 07:37:15 PST 2008


Hi,

Attached patch fixes memory leak. It frees memory allocated dynamically 

for QOS options while doing rescan of qos configuration file.

 

 

diff --git a/opensm/opensm/osm_subnet.c b/opensm/opensm/osm_subnet.c

index c41962d..3dab92f 100644

--- a/opensm/opensm/osm_subnet.c

+++ b/opensm/opensm/osm_subnet.c

@@ -374,8 +374,17 @@ static void subn_init_qos_options(IN
osm_qos_options_t * opt)

 {

            opt->max_vls = 0;

            opt->high_limit = -1;

+          if  (opt->vlarb_high != OSM_DEFAULT_QOS_VLARB_HIGH) {

+                      free(opt->vlarb_high);

+          }

            opt->vlarb_high = NULL;

+          if  (opt->vlarb_low != OSM_DEFAULT_QOS_VLARB_LOW) {

+          free(opt->vlarb_low);

+          }

            opt->vlarb_low = NULL;

+          if  (opt->sl2vl != OSM_DEFAULT_QOS_SL2VL) {

+                      free(opt->sl2vl);

+          }

            opt->sl2vl = NULL;

 }

 

 

 

Slava Strebkov

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20081216/c6b8ddd1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qos_options_free.patch
Type: application/octet-stream
Size: 653 bytes
Desc: qos_options_free.patch
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20081216/c6b8ddd1/attachment.obj>


More information about the general mailing list