From ec60ca1061574f7c28a5ec226fb2553d2a0c8326 Mon Sep 17 00:00:00 2001 From: "Kaleb S. KEITHLEY" Date: Fri, 29 Nov 2013 08:03:30 -0500 Subject: glusterfsd: fix small memory leaks in glusterfsd-mgmt.c E.g. In glusterfs_volfile_fetch(), req.xdata.xdata_val is allocated in dict_allocate_and_serialize() but not freed after mgmt_submit_request(). A survey of dict_allocate_and_serialize/_submit_request in glusterfsd-mgmt.c shows no consistent pattern of freeing the xdata_val and also the dict, which is a little disturbing. (Yes, clearly not every place this occurs needs to be freed the same way.) Change-Id: I8f31179ae12c05c9b5406d8e9e28110fcbfac1c7 BUG: 1036102 Signed-off-by: Kaleb S. KEITHLEY Reviewed-on: http://review.gluster.org/6381 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- glusterfsd/src/glusterfsd-mgmt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c index 62a77ea56cc..08d95f37266 100644 --- a/glusterfsd/src/glusterfsd-mgmt.c +++ b/glusterfsd/src/glusterfsd-mgmt.c @@ -1732,7 +1732,12 @@ glusterfs_volfile_fetch (glusterfs_ctx_t *ctx) ret = mgmt_submit_request (&req, frame, ctx, &clnt_handshake_prog, GF_HNDSK_GETSPEC, mgmt_getspec_cbk, (xdrproc_t)xdr_gf_getspec_req); + out: + GF_FREE (req.xdata.xdata_val); + if (dict) + dict_unref (dict); + return ret; } -- cgit