Gitweb:
http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=77bb92ad9db...
Commit: 77bb92ad9dbad9c8755e45211214ab1e099cdb0e
Parent: 6c9717cbbca38ee94911cbbc481c310f6375d560
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Jul 23 17:01:57 2012 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Jul 23 17:01:57 2012 -0500
fenced: fix double free when second method has no devices
When the second fence method is empty, the already
freed device is freed again, causing a segfault.
bz 809390
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
fence/fenced/agent.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/fence/fenced/agent.c b/fence/fenced/agent.c
index 753b915..de4467c 100644
--- a/fence/fenced/agent.c
+++ b/fence/fenced/agent.c
@@ -361,8 +361,10 @@ int dispatch_fence_agent(char *victim, int force)
device = NULL;
}
- if (device)
+ if (device) {
free(device);
+ device = NULL;
+ }
free(method);
if (!error) {