From de914ca73b320b8e87a3a9a560f5f1a987b4424d Mon Sep 17 00:00:00 2001 From: "Fabio M. Di Nitto" Date: Tue, 17 Jan 2012 10:53:17 +0100 Subject: [PATCH] vsf_quorum: fix potential memory leak Signed-off-by: Fabio M. Di Nitto Reviewed-by: Angus Salkeld --- exec/vsf_quorum.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/exec/vsf_quorum.c b/exec/vsf_quorum.c index c258c145..e0831e13 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