public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: David Teigland <teigland@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: fence: master - libfence: fix premature free of victim name
Date: Wed, 25 Feb 2009 18:00:00 -0000	[thread overview]
Message-ID: <20090225175940.257D51201D4@lists.fedorahosted.org> (raw)

Gitweb:        http://git.fedorahosted.org/git/fence.git?p=fence.git;a=commitdiff;h=8acba87a2d2788cff9fdbfb6b9f3a277a171b8f5
Commit:        8acba87a2d2788cff9fdbfb6b9f3a277a171b8f5
Parent:        dbb04917012761351f5402d5786e5ec5149be14b
Author:        Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate:    Wed Feb 25 09:39:36 2009 +0100
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Wed Feb 25 11:57:11 2009 -0600

libfence: fix premature free of victim name

also fixes fencing for multiple methods

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
 fence/libfence/agent.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/fence/libfence/agent.c b/fence/libfence/agent.c
index 883202f..51e9371 100644
--- a/fence/libfence/agent.c
+++ b/fence/libfence/agent.c
@@ -377,8 +377,7 @@ int fence_node(char *victim, struct fence_log *log, int log_size,
 
 		if (device)
 			free(device);
-		if (victim_nodename)
-			free(victim_nodename);
+
 		free(method);
 
 		/* we return 0 for fencing success when use_device has
@@ -387,6 +386,9 @@ int fence_node(char *victim, struct fence_log *log, int log_size,
 		if (!error)
 			break;
 	}
+
+	if (victim_nodename)
+		free(victim_nodename);
  out:
 	ccs_disconnect(cd);
  ret:


                 reply	other threads:[~2009-02-25 18:00 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=20090225175940.257D51201D4@lists.fedorahosted.org \
    --to=teigland@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).