[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] [PATCH 5/5] rgmanager: Fix a possible NULL pointer dereference



Fix a NULL pointer dereference that could happen when cman_get_node_count()
returns 0 with errno set to EINTR.

Possibly resolves rhbz#820632

Signed-off-by: Ryan McCabe <rmccabe redhat com>
---
 rgmanager/src/clulib/members.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/rgmanager/src/clulib/members.c b/rgmanager/src/clulib/members.c
index f705297..72f4529 100644
--- a/rgmanager/src/clulib/members.c
+++ b/rgmanager/src/clulib/members.c
@@ -367,8 +367,10 @@ get_member_list(cman_handle_t h)
 
 	do {	
 		++tries;
-		if (nodes)
+		if (nodes) {
 			free(nodes);
+			nodes = NULL;
+		}
 
 		c = cman_get_node_count(h);
 		if (c <= 0) {
-- 
1.7.10.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]