diff options
author | Mohit Agrawal <moagrawal@redhat.com> | 2018-12-07 14:36:45 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2019-01-16 17:31:59 +0000 |
commit | 98550952bef0d84677706e75ff53a41dc8c90dec (patch) | |
tree | cecb4c1be02d0bdf9c865b27fb4364aa11a58364 /glusterfsd/src/glusterfsd-mgmt.c | |
parent | 213f31bf9e72eee57a6579b66e259af8e59e9c67 (diff) |
core: Resolve memory leak for brick
Problem: Some functions are not freeing memory allocated by
xdr_to_genric so it has become leak
Solution: Call free to avoid leak
Change-Id: I3524fe2831d1511d378a032f21467edae3850314
fixes: bz#1656682
Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
Diffstat (limited to 'glusterfsd/src/glusterfsd-mgmt.c')
-rw-r--r-- | glusterfsd/src/glusterfsd-mgmt.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c index 3c3c1ef997c..7c5ce523d26 100644 --- a/glusterfsd/src/glusterfsd-mgmt.c +++ b/glusterfsd/src/glusterfsd-mgmt.c @@ -282,6 +282,8 @@ glusterfs_handle_terminate(rpcsvc_request_t *req) err: if (!lockflag) UNLOCK(&ctx->volfile_lock); + if (xlator_req.input.input_val) + free(xlator_req.input.input_val); free(xlator_req.name); xlator_req.name = NULL; return 0; @@ -1030,6 +1032,8 @@ out: GF_FREE(msg); GF_FREE(filepath); + if (xlator_req.input.input_val) + free(xlator_req.input.input_val); return ret; } @@ -1250,6 +1254,7 @@ out: if (output) dict_unref(output); free(brick_req.input.input_val); + free(brick_req.name); GF_FREE(xname); GF_FREE(msg); GF_FREE(rsp.output.output_val); @@ -2117,7 +2122,8 @@ out: GF_FREE(frame->local); frame->local = NULL; STACK_DESTROY(frame->root); - + if (rsp.xdata.xdata_val) + free(rsp.xdata.xdata_val); free(rsp.spec); if (dict) |