This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: STABLE3 - cman: don't double free if a key doesn't existwhile reloading


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);
 	}
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]