This is the mail archive of the
cluster-cvs@sourceware.org
mailing list for the cluster.
cluster: master - cman: fix memory leak
- From: Christine Caulfield <chrissie at fedoraproject dot org>
- To: cluster-cvs-relay at redhat dot com
- Date: Fri, 12 Dec 2008 10:30:59 +0000 (UTC)
- Subject: cluster: master - cman: fix memory leak
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=8776b161773b4ca3a6ce077db1f232ba68ee9918
Commit: 8776b161773b4ca3a6ce077db1f232ba68ee9918
Parent: d8b4d87c8fd9502aea03f1782a3178b2828ef0d2
Author: Christine Caulfield <ccaulfie@redhat.com>
AuthorDate: Fri Dec 12 10:30:12 2008 +0000
Committer: Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Fri Dec 12 10:30:12 2008 +0000
cman: fix memory leak
This is a very small memory leak but it could add up in some
very long-lived processes that send a lot of messages.
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
---
cman/lib/libcman.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/cman/lib/libcman.c b/cman/lib/libcman.c
index dcda014..b05011c 100644
--- a/cman/lib/libcman.c
+++ b/cman/lib/libcman.c
@@ -464,6 +464,7 @@ int cman_dispatch(cman_handle_t handle, int flags)
res = process_cman_message(h, flags, smsg->msg);
h->saved_reply_msg = smsg->next;
len = smsg->msg->length;
+ free(smsg->msg);
free(smsg);
if (res || (flags & CMAN_DISPATCH_ONE))
break;
@@ -477,6 +478,7 @@ int cman_dispatch(cman_handle_t handle, int flags)
res = process_cman_message(h, flags, smsg->msg);
h->saved_data_msg = smsg->next;
len = smsg->msg->length;
+ free(smsg->msg);
free(smsg);
if (res || (flags & CMAN_DISPATCH_ONE))
break;
@@ -490,6 +492,7 @@ int cman_dispatch(cman_handle_t handle, int flags)
res = process_cman_message(h, flags, smsg->msg);
h->saved_event_msg = smsg->next;
len = smsg->msg->length;
+ free(smsg->msg);
free(smsg);
if (res || (flags & CMAN_DISPATCH_ONE))
break;