diff mbox series

[opensm,2/2] osm_opensm.c: destroy_routing_engines should destory the default routing engine

Message ID 20181129110750.5276-2-honli@redhat.com (mailing list archive)
State Not Applicable
Headers show
Series [opensm,1/2] osm_subnet.c: subn_opt_destroy free per_module_logging_file | expand

Commit Message

Honggang LI Nov. 29, 2018, 11:07 a.m. UTC
Signed-off-by: Honggang Li <honli@redhat.com>
---
 opensm/osm_opensm.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Hal Rosenstock Nov. 29, 2018, 12:45 p.m. UTC | #1
On 11/29/2018 6:07 AM, Honggang Li wrote:
> Signed-off-by: Honggang Li <honli@redhat.com>

Thanks. Both applied.

-- Hal
diff mbox series

Patch

diff --git a/opensm/osm_opensm.c b/opensm/osm_opensm.c
index be867fee..f73d0fa3 100644
--- a/opensm/osm_opensm.c
+++ b/opensm/osm_opensm.c
@@ -276,6 +276,13 @@  static void destroy_routing_engines(osm_opensm_t *osm)
 			r->destroy(r->context);
 		free(r);
 	}
+
+	r = osm->default_routing_engine;
+	if (r) {
+		if (r->destroy)
+			r->destroy(r->context);
+		free(r);
+	}
 }
 
 static void destroy_plugins(osm_opensm_t *osm)