[corosync] [PATCH 7/7] TOTEM: better clean up on exit

Angus Salkeld asalkeld at redhat.com
Thu Nov 10 10:54:56 GMT 2011


Signed-off-by: Angus Salkeld <asalkeld at redhat.com>
---
 exec/totemrrp.c |    3 ++-
 exec/totemsrp.c |    8 +++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/exec/totemrrp.c b/exec/totemrrp.c
index 41f2604..452a1e6 100644
--- a/exec/totemrrp.c
+++ b/exec/totemrrp.c
@@ -1781,7 +1781,8 @@ int totemrrp_finalize (
 	for (i = 0; i < instance->interface_count; i++) {
 		totemnet_finalize (instance->net_handles[i]);
 	}
-
+	free (instance->net_handles);
+	free (instance);
 	return (0);
 }
 
diff --git a/exec/totemsrp.c b/exec/totemsrp.c
index 0778d55..0662812 100644
--- a/exec/totemsrp.c
+++ b/exec/totemsrp.c
@@ -975,8 +975,14 @@ void totemsrp_finalize (
 {
 	struct totemsrp_instance *instance = (struct totemsrp_instance *)srp_context;
 
+
 	memb_leave_message_send (instance);
-	free (srp_context);
+	totemrrp_finalize (instance->totemrrp_context);
+	cs_queue_free (&instance->new_message_queue);
+	cs_queue_free (&instance->retrans_message_queue);
+	sq_free (&instance->regular_sort_queue);
+	sq_free (&instance->recovery_sort_queue);
+	free (instance);
 }
 
 int totemsrp_ifaces_get (
-- 
1.7.7



More information about the discuss mailing list