From 69a7f2fea23880fbdc776b657dd6aa32c643c6c4 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 14 Feb 2012 15:50:40 +0530 Subject: 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 Reviewed-on: http://review.gluster.com/2746 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- rpc/rpc-lib/src/auth-glusterfs.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'rpc/rpc-lib') 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; } -- cgit