[PATCH 03/10] vsf_quorum: fix potential memory leak

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

 



From: "Fabio M. Di Nitto" <fdinitto@xxxxxxxxxx>

Signed-off-by: Fabio M. Di Nitto <fdinitto@xxxxxxxxxx>
---
:100644 100644 c258c14... e0831e1... M	exec/vsf_quorum.c
 exec/vsf_quorum.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/exec/vsf_quorum.c b/exec/vsf_quorum.c
index c258c14..e0831e1 100644
--- a/exec/vsf_quorum.c
+++ b/exec/vsf_quorum.c
@@ -252,7 +252,7 @@ static struct quorum_callin_functions callins = {
 
 static int quorum_exec_init_fn (struct corosync_api_v1 *api)
 {
-	char *quorum_module;
+	char *quorum_module = NULL;
 
 #ifdef COROSYNC_SOLARIS
 	logsys_subsys_init();
@@ -280,6 +280,11 @@ static int quorum_exec_init_fn (struct corosync_api_v1 *api)
 		}
 	}
 
+	if (quorum_module) {
+		free(quorum_module);
+		quorum_module = NULL;
+	}
+
 	/*
 	 * setting quorum_type and primary_designated in the right order is important
 	 * always try to lookup/init a quorum module, then revert back to be quorate
-- 
1.7.7.5

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux