summaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2012-02-14 15:50:40 +0530
committerAnand Avati <avati@redhat.com>2012-02-14 04:27:29 -0800
commit69a7f2fea23880fbdc776b657dd6aa32c643c6c4 (patch)
treebce36f07f7a120c6a2fa94f09c2c59a8c51014e3 /rpc
parentb27512e006ae55777f481937d321f60fa195c48d (diff)
rpc : fix the leak with glusterfs v2 auth structure conversion
both 'groups' and 'lkowner' were getting leaked after the conversion Change-Id: Iab7cc1cf5afdad18ead9f33e6ccf98e0a934a09a BUG: 790298 Signed-off-by: Amar Tumballi <amar@gluster.com> Reviewed-on: http://review.gluster.com/2746 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'rpc')
-rw-r--r--rpc/rpc-lib/src/auth-glusterfs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/rpc/rpc-lib/src/auth-glusterfs.c b/rpc/rpc-lib/src/auth-glusterfs.c
index 9996bfad4..47d197c05 100644
--- a/rpc/rpc-lib/src/auth-glusterfs.c
+++ b/rpc/rpc-lib/src/auth-glusterfs.c
@@ -221,6 +221,12 @@ int auth_glusterfs_v2_authenticate (rpcsvc_request_t *req, void *priv)
req->pid, req->uid, req->gid, lkowner_utoa (&req->lk_owner));
ret = RPCSVC_AUTH_ACCEPT;
err:
+ /* TODO: instead use alloca() for these variables */
+ if (au.groups.groups_val)
+ free (au.groups.groups_val);
+ if (au.lk_owner.lk_owner_val)
+ free (au.lk_owner.lk_owner_val);
+
return ret;
}