From 5c94a07771924eab35b0609074581c89475cc6fa Mon Sep 17 00:00:00 2001 From: Erik Boasson Date: Sun, 14 Jun 2020 16:02:58 +0200 Subject: [PATCH] Fix bogus deinit of security state on init error The deinitialize would happen on most errors, but in all those cases it would not have been initialized yet. Signed-off-by: Erik Boasson --- src/core/ddsi/src/q_init.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/core/ddsi/src/q_init.c b/src/core/ddsi/src/q_init.c index 15eb67c..29a2f00 100644 --- a/src/core/ddsi/src/q_init.c +++ b/src/core/ddsi/src/q_init.c @@ -1525,6 +1525,14 @@ int rtps_init (struct ddsi_domaingv *gv) qxev_callback (gv->xevents, reset_deaf_mute_time, reset_deaf_mute, gv); return 0; +#if 0 +#ifdef DDSI_INCLUDE_SECURITY +err_post_omg_security_init: + q_omg_security_stop (gv); // should be a no-op as it starts lazily + q_omg_security_deinit(gv->security_context); + q_omg_security_free (gv); +#endif +#endif err_mc_conn: if (gv->xmit_conn) ddsi_conn_free (gv->xmit_conn); @@ -1562,9 +1570,6 @@ err_unicast_sockets: ddsrt_hh_free (gv->sertopics); ddsrt_mutex_destroy (&gv->sertopics_lock); #ifdef DDSI_INCLUDE_SECURITY - q_omg_security_stop (gv); // should be a no-op as it starts lazily - q_omg_security_deinit(gv->security_context); - q_omg_security_free (gv); ddsi_xqos_fini (&gv->builtin_stateless_xqos_wr); ddsi_xqos_fini (&gv->builtin_stateless_xqos_rd); ddsi_xqos_fini (&gv->builtin_volatile_xqos_wr);