From 1ad41c4ca167e4600f163408c1f859d55cdbdc07 Mon Sep 17 00:00:00 2001 From: Poornima Date: Wed, 12 Feb 2014 03:18:43 +0000 Subject: protocol/client: Fix the possible resource leaks. Change-Id: Ib86dee366f5a6f0971c6472d1fb2c32dbf7f0102 BUG: 789278 Signed-off-by: Poornima Reviewed-on: http://review.gluster.org/6985 Reviewed-by: Vijay Bellur Reviewed-by: Raghavendra Talur Tested-by: Gluster Build System --- xlators/protocol/client/src/client-rpc-fops.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'xlators/protocol/client') diff --git a/xlators/protocol/client/src/client-rpc-fops.c b/xlators/protocol/client/src/client-rpc-fops.c index 01590d73a..99a6f6d74 100644 --- a/xlators/protocol/client/src/client-rpc-fops.c +++ b/xlators/protocol/client/src/client-rpc-fops.c @@ -3068,13 +3068,13 @@ client3_3_lookup (call_frame_t *frame, xlator_t *this, op_errno = ENOMEM; goto unwind; } + frame->local = local; if (!(args->loc && args->loc->inode)) goto unwind; loc_copy (&local->loc, args->loc); loc_path (&local->loc, NULL); - frame->local = local; if (args->loc->parent) { if (!uuid_is_null (args->loc->parent->gfid)) @@ -3792,13 +3792,13 @@ client3_3_mknod (call_frame_t *frame, xlator_t *this, op_errno = ENOMEM; goto unwind; } + frame->local = local; if (!(args->loc && args->loc->parent)) goto unwind; loc_copy (&local->loc, args->loc); loc_path (&local->loc, NULL); - frame->local = local; if (!uuid_is_null (args->loc->parent->gfid)) memcpy (req.pargfid, args->loc->parent->gfid, 16); @@ -3860,13 +3860,13 @@ client3_3_mkdir (call_frame_t *frame, xlator_t *this, op_errno = ENOMEM; goto unwind; } + frame->local = local; if (!(args->loc && args->loc->parent)) goto unwind; loc_copy (&local->loc, args->loc); loc_path (&local->loc, NULL); - frame->local = local; if (!uuid_is_null (args->loc->parent->gfid)) memcpy (req.pargfid, args->loc->parent->gfid, 16); @@ -3927,6 +3927,8 @@ client3_3_create (call_frame_t *frame, xlator_t *this, op_errno = ENOMEM; goto unwind; } + frame->local = local; + if (!(args->loc && args->loc->parent)) goto unwind; @@ -3935,7 +3937,6 @@ client3_3_create (call_frame_t *frame, xlator_t *this, loc_copy (&local->loc, args->loc); loc_path (&local->loc, NULL); - frame->local = local; if (!uuid_is_null (args->loc->parent->gfid)) memcpy (req.pargfid, args->loc->parent->gfid, 16); @@ -3998,6 +3999,8 @@ client3_3_open (call_frame_t *frame, xlator_t *this, op_errno = ENOMEM; goto unwind; } + frame->local = local; + if (!(args->loc && args->loc->inode)) goto unwind; @@ -4005,7 +4008,6 @@ client3_3_open (call_frame_t *frame, xlator_t *this, local->flags = args->flags; loc_copy (&local->loc, args->loc); loc_path (&local->loc, NULL); - frame->local = local; if (!uuid_is_null (args->loc->inode->gfid)) memcpy (req.gfid, args->loc->inode->gfid, 16); @@ -4388,13 +4390,14 @@ client3_3_opendir (call_frame_t *frame, xlator_t *this, op_errno = ENOMEM; goto unwind; } + frame->local = local; + if (!(args->loc && args->loc->inode)) goto unwind; local->fd = fd_ref (args->fd); loc_copy (&local->loc, args->loc); loc_path (&local->loc, NULL); - frame->local = local; if (!uuid_is_null (args->loc->inode->gfid)) memcpy (req.gfid, args->loc->inode->gfid, 16); @@ -5251,6 +5254,7 @@ client3_3_lk (call_frame_t *frame, xlator_t *this, op_errno = ENOMEM; goto unwind; } + frame->local = local; CLIENT_GET_REMOTE_FD (this, args->fd, DEFAULT_REMOTE_FD, remote_fd, op_errno, unwind); @@ -5278,7 +5282,6 @@ client3_3_lk (call_frame_t *frame, xlator_t *this, local->owner = frame->root->lk_owner; local->cmd = args->cmd; local->fd = fd_ref (args->fd); - frame->local = local; req.fd = remote_fd; req.cmd = gf_cmd; -- cgit