diff options
author | Mohit Agrawal <moagrawal@redhat.com> | 2018-11-21 14:33:53 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-12-12 22:58:49 +0000 |
commit | 607bbd935f102602810fdeb61079b85ecb58a118 (patch) | |
tree | fd001998b7a40102b4b778600eb397fa5ddfcdaf | |
parent | c9d117d54aea1d775e0eef1881892d11fa12811e (diff) |
rpc: Resolve memory leak in mgmt_pmap_signout_cbk
Problem: At the time of submit signout request to mgmt
rpc_clnt_mgmt_pmap_signout create a frame but in cbk
frame is not destroyed
Solution: cleanup frame in mgmt_pmap_signout_cbk to avoid leak
Change-Id: I9961cacb2e02c8023c4c99e22e299b8729c2b09f
fixes: bz#1658045
Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
-rw-r--r-- | rpc/rpc-lib/src/mgmt-pmap.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/rpc/rpc-lib/src/mgmt-pmap.c b/rpc/rpc-lib/src/mgmt-pmap.c index ccb56a479c4..15f2b61cd05 100644 --- a/rpc/rpc-lib/src/mgmt-pmap.c +++ b/rpc/rpc-lib/src/mgmt-pmap.c @@ -35,7 +35,9 @@ mgmt_pmap_signout_cbk(struct rpc_req *req, struct iovec *iov, int count, 0, }; int ret = 0; + call_frame_t *frame = NULL; + frame = myframe; if (-1 == req->rpc_status) { rsp.op_ret = -1; rsp.op_errno = EINVAL; @@ -56,6 +58,10 @@ mgmt_pmap_signout_cbk(struct rpc_req *req, struct iovec *iov, int count, goto out; } out: + if (frame) { + STACK_DESTROY(frame->root); + } + return 0; } |