summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXie Changlong <xiechanglong@cmss.chinamobile.com>2020-01-19 17:54:51 +0800
committerAmar Tumballi <amar@kadalu.io>2020-01-23 16:59:43 +0000
commit22b8564e781d2113327a0dc17dd4414a6386f2e1 (patch)
tree1d17c7393e1dad42ab954ae4fb87c7d6d7548689
parent92bf7634d67a574dba6d7e77501d605d7f33acc3 (diff)
snapview: fix memory leak
Setting frame->local = local immediately after mem_get0. In this case, SVC_STACK_UNWIND will take of freeing the memory. Change-Id: If6433be0e14ed0f4ab4127f70a8875f81bb3e6b8 updates: bz#789278 Signed-off-by: Xie Changlong <xiechanglong@cmss.chinamobile.com>
-rw-r--r--xlators/features/snapview-client/src/snapview-client.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/xlators/features/snapview-client/src/snapview-client.c b/xlators/features/snapview-client/src/snapview-client.c
index 9c789ae..f22d4eb 100644
--- a/xlators/features/snapview-client/src/snapview-client.c
+++ b/xlators/features/snapview-client/src/snapview-client.c
@@ -755,13 +755,12 @@ gf_svc_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd,
loc->path, uuid_utoa(fd->inode->gfid));
goto out;
}
+ loc_copy(&local->loc, loc);
+ frame->local = local;
SVC_GET_SUBVOL_FROM_CTX(this, op_ret, op_errno, inode_type, ret, loc->inode,
subvolume, out);
-
- loc_copy(&local->loc, loc);
local->subvolume = subvolume;
- frame->local = local;
STACK_WIND(frame, gf_svc_opendir_cbk, subvolume, subvolume->fops->opendir,
loc, fd, xdata);