summaryrefslogtreecommitdiffstats
path: root/glusterfsd/src/glusterfsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'glusterfsd/src/glusterfsd.c')
-rw-r--r--glusterfsd/src/glusterfsd.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index f9f263aae6..106bfe3bcc 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -2583,11 +2583,14 @@ out:
if (fp)
fclose(fp);
- if (ret && !ctx->active) {
- glusterfs_graph_destroy(graph);
+ if (ret) {
+ if (graph && (ctx && (ctx->active != graph)))
+ glusterfs_graph_destroy(graph);
/* there is some error in setting up the first graph itself */
- emancipate(ctx, ret);
- cleanup_and_exit(ret);
+ if (!ctx->active) {
+ emancipate(ctx, ret);
+ cleanup_and_exit(ret);
+ }
}
return ret;