From 22b8564e781d2113327a0dc17dd4414a6386f2e1 Mon Sep 17 00:00:00 2001 From: Xie Changlong Date: Sun, 19 Jan 2020 17:54:51 +0800 Subject: 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 --- xlators/features/snapview-client/src/snapview-client.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'xlators/features/snapview-client') diff --git a/xlators/features/snapview-client/src/snapview-client.c b/xlators/features/snapview-client/src/snapview-client.c index 9c789ae447b..f22d4eb70a8 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); -- cgit