This is the mail archive of the
cluster-cvs@sourceware.org
mailing list for the cluster.
cluster: RHEL5 - cman: fix memory leak
- From: Christine Caulfield <chrissie at fedoraproject dot org>
- To: cluster-cvs-relay at redhat dot com
- Date: Tue, 16 Dec 2008 08:53:12 +0000 (UTC)
- Subject: cluster: RHEL5 - cman: fix memory leak
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=0f32c58025a75bcaf05f62b3ecd7e05e389c37eb
Commit: 0f32c58025a75bcaf05f62b3ecd7e05e389c37eb
Parent: 1761a11c1f659482caf24a9131b091b030c938bd
Author: Christine Caulfield <ccaulfie@redhat.com>
AuthorDate: Fri Dec 12 10:30:12 2008 +0000
Committer: Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Tue Dec 16 08:53:05 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 1c74748..c7118f5 100644
--- a/cman/lib/libcman.c
+++ b/cman/lib/libcman.c
@@ -485,6 +485,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;
@@ -498,6 +499,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;
@@ -511,6 +513,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;