From 3f0525e65e7eb1d48610f13152b676dd6d9208f5 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Wed, 16 Feb 2011 01:41:44 +0000 Subject: 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 Signed-off-by: Anand V. Avati BUG: 2421 ([glusterfs-3.1.2gsync10]: epoll_create returning 0) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2421 --- xlators/mgmt/glusterd/src/glusterd-volgen.c | 1 + 1 file changed, 1 insertion(+) (limited to 'xlators/mgmt/glusterd') 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; -- cgit