public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: Christine Caulfield <chrissie@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: cluster: STABLE3 - cman: don't double free if a key doesn't exist while reloading
Date: Wed, 14 Jan 2009 13:59:00 -0000	[thread overview]
Message-ID: <20090114135841.64E55120522@lists.fedorahosted.org> (raw)

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=8e5f8ad50b963842a98ced4be7595f1544a945e6
Commit:        8e5f8ad50b963842a98ced4be7595f1544a945e6
Parent:        f4f5f41e46e08f55d7a76c6c26605d74b1219f2b
Author:        Christine Caulfield <ccaulfie@redhat.com>
AuthorDate:    Wed Jan 14 13:57:37 2009 +0000
Committer:     Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Wed Jan 14 13:57:37 2009 +0000

cman: don't double free if a key doesn't exist while reloading

The return from object_find_next wasn't being checked correctly
so an old object ID could be freed if the next one wasn't found.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
---
 cman/daemon/cman-preconfig.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c
index 4b721bf..039deea 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -1060,9 +1060,9 @@ static int cmanpre_reloadconfig(struct objdb_iface_ver0 *objdb, int flush, char
 
 	/* destroy top level /logging */
 	objdb->object_find_create(OBJECT_PARENT_HANDLE, "logging", strlen("logging"), &find_handle);
-	objdb->object_find_next(find_handle, &object_handle);
+	ret = objdb->object_find_next(find_handle, &object_handle);
 	objdb->object_find_destroy(find_handle);
-	if (object_handle) {
+	if (ret) {
 		objdb->object_destroy(object_handle);
 	}
 
@@ -1071,9 +1071,9 @@ static int cmanpre_reloadconfig(struct objdb_iface_ver0 *objdb, int flush, char
 
 	/* destroy top level /totem */
 	objdb->object_find_create(OBJECT_PARENT_HANDLE, "totem", strlen("totem"), &find_handle);
-	objdb->object_find_next(find_handle, &object_handle);
+	ret = objdb->object_find_next(find_handle, &object_handle);
 	objdb->object_find_destroy(find_handle);
-	if (object_handle) {
+	if (ret) {
 		objdb->object_destroy(object_handle);
 	}
 


                 reply	other threads:[~2009-01-14 13:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090114135841.64E55120522@lists.fedorahosted.org \
    --to=chrissie@fedoraproject.org \
    --cc=cluster-cvs-relay@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).