From 20c5d47ef62b94330f1335a1c403406e9ad636d4 Mon Sep 17 00:00:00 2001 From: "Kaleb S. KEITHLEY" Date: Fri, 29 Nov 2013 08:23:47 -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: Id3f81346c0c863fa06c7b780a634e9b4ed68e453 BUG: 1036102 Signed-off-by: Kaleb S. KEITHLEY Reviewed-on: http://review.gluster.org/6384 Reviewed-by: Santosh Pradhan Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- configure.ac | 2 +- glusterfsd/src/glusterfsd-mgmt.c | 5 +++++ rfc.sh | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 7bfee047ae2..d76c018efee 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ dnl General Public License, version 3 or any later version (LGPLv3 or dnl later), or the GNU General Public License, version 2 (GPLv2), in all dnl cases as published by the Free Software Foundation. -AC_INIT([glusterfs],[3git],[gluster-users@gluster.org],,[https://github.com/gluster/glusterfs.git]) +AC_INIT([glusterfs],[3.5git],[gluster-users@gluster.org],,[https://github.com/gluster/glusterfs.git]) AM_INIT_AUTOMAKE diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c index bbfc5059361..0484779ce55 100644 --- a/glusterfsd/src/glusterfsd-mgmt.c +++ b/glusterfsd/src/glusterfsd-mgmt.c @@ -1456,7 +1456,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; } diff --git a/rfc.sh b/rfc.sh index 04efa6f3e5f..57644126db1 100755 --- a/rfc.sh +++ b/rfc.sh @@ -1,7 +1,7 @@ #!/bin/sh -e -branch="master"; +branch="release-3.5"; set_hooks_commit_msg() -- cgit