summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/ha/src/ha-helpers.c
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2009-10-01 06:59:03 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-10-01 07:23:46 -0700
commit398de05aeba82ddfa055e8696521f3d5a4cbabe5 (patch)
treec2b35a1a38d6cb5e54a528ca82dab8f28a0e9993 /xlators/cluster/ha/src/ha-helpers.c
parent3e25f229787c1b53ab61333a41345a35c070e089 (diff)
ha: Handle memory allocation failures
Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 145 (NFSv3 related additions to 2.1 task list) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=145
Diffstat (limited to 'xlators/cluster/ha/src/ha-helpers.c')
-rw-r--r--xlators/cluster/ha/src/ha-helpers.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/xlators/cluster/ha/src/ha-helpers.c b/xlators/cluster/ha/src/ha-helpers.c
index 4bc7d5e20de..a8c1bff9968 100644
--- a/xlators/cluster/ha/src/ha-helpers.c
+++ b/xlators/cluster/ha/src/ha-helpers.c
@@ -141,11 +141,17 @@ int ha_handle_cbk (call_frame_t *frame, void *cookie, int op_ret, int op_errno)
}
}
}
- if (local->stub)
+ if (local->stub) {
call_stub_destroy (local->stub);
+ local->stub = NULL;
+ }
+
if (local->fd) {
FREE (local->state);
+ local->state = NULL;
+
fd_unref (local->fd);
+ local->fd = NULL;
}
return 0;
}