summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnand Avati <avati@gluster.com>2011-02-16 01:41:44 +0000
committerAnand V. Avati <avati@dev.gluster.com>2011-02-15 23:52:19 -0800
commit3f0525e65e7eb1d48610f13152b676dd6d9208f5 (patch)
tree5a90e6176f944aa2bd196be78a288cf3f9558742
parent43b68bb25c9ee16c10342ef643a6ecb82a345e16 (diff)
volgen: avoid fclose() on cosed FILE *
It can so happen that a previously freed up FILE * structure has 0'ed out memory and a second fclose() on it can result in close(0). This results in bad bad things happening. Signed-off-by: Anand Avati <avati@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2421 ([glusterfs-3.1.2gsync10]: epoll_create returning 0) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2421
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 410b6cd72b3..4de6263629d 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -837,6 +837,7 @@ volgen_write_volfile (glusterfs_graph_t *graph, char *filename)
if (fclose (f) == -1)
goto error;
+ f = NULL;
if (rename (ftmp, filename) == -1)
goto error;