summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-sm.c
diff options
context:
space:
mode:
authorPranith K <pranithk@gluster.com>2010-10-08 01:37:54 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-10-08 04:28:55 -0700
commitd4b0360c8c4c5dab692f827972ccea0e728af688 (patch)
tree6c5d32b86feba35d007f057fc43d885ff2cffdb3 /xlators/mgmt/glusterd/src/glusterd-sm.c
parentce616c5fa08722044ee311f5f6c7c4e3ccb684c4 (diff)
mgmt/glusterd: memory leak fixes
Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1726 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1726
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-sm.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-sm.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-sm.c b/xlators/mgmt/glusterd/src/glusterd-sm.c
index 051bdee91..6061d0276 100644
--- a/xlators/mgmt/glusterd/src/glusterd-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-sm.c
@@ -129,10 +129,9 @@ glusterd_broadcast_friend_delete (char *hostname, uuid_t uuid)
{
int ret = 0;
rpc_clnt_procedure_t *proc = NULL;
- call_frame_t *frame = NULL;
glusterd_conf_t *conf = NULL;
xlator_t *this = NULL;
- glusterd_friend_update_ctx_t *ctx = NULL;
+ glusterd_friend_update_ctx_t ctx = {{0},};
this = THIS;
conf = this->private;
@@ -140,27 +139,13 @@ glusterd_broadcast_friend_delete (char *hostname, uuid_t uuid)
GF_ASSERT (conf);
GF_ASSERT (conf->mgmt);
- ctx = GF_CALLOC (1, sizeof (*ctx),
- gf_gld_mt_friend_update_ctx_t);
-
- if (!ctx) {
- ret = -1;
- goto out;
- }
-
- ctx->hostname = gf_strdup (hostname);
- ctx->op = GD_FRIEND_UPDATE_DEL;
+ ctx.hostname = hostname;
+ ctx.op = GD_FRIEND_UPDATE_DEL;
proc = &conf->mgmt->proctable[GD_MGMT_FRIEND_UPDATE];
if (proc->fn) {
- frame = create_frame (this, this->ctx->pool);
- if (!frame) {
- goto out;
- }
- frame->local = ctx;
- ret = proc->fn (frame, this, ctx);
+ ret = proc->fn (NULL, this, &ctx);
}
-out:
gf_log ("", GF_LOG_DEBUG, "Returning with %d", ret);
return ret;