a3470f
From 5f7e699d159577a41a35085648669ea56fa80bf0 Mon Sep 17 00:00:00 2001
a3470f
From: Amar Tumballi <amarts@redhat.com>
a3470f
Date: Tue, 21 Aug 2018 10:54:46 +0530
a3470f
Subject: [PATCH 355/359] server-protocol: resolve memory leak
a3470f
a3470f
This leak got introduced as part of d15e6e444 where 'alloca()' calls
a3470f
were removed in server protocol. Notice that only 'lookup()' has
a3470f
two places where there is return, hence we needed free in 2 places,
a3470f
not 1.
a3470f
a3470f
BUG: 1619416
a3470f
Change-Id: I32c20a33d7a1c8862588b50455765a92095469a6
a3470f
Signed-off-by: Amar Tumballi <amarts@redhat.com>
a3470f
Reviewed-on: https://code.engineering.redhat.com/gerrit/147574
a3470f
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
a3470f
Tested-by: RHGS Build Bot <nigelb@redhat.com>
a3470f
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
a3470f
---
a3470f
 xlators/protocol/server/src/server-rpc-fops.c | 3 +++
a3470f
 1 file changed, 3 insertions(+)
a3470f
a3470f
diff --git a/xlators/protocol/server/src/server-rpc-fops.c b/xlators/protocol/server/src/server-rpc-fops.c
a3470f
index a7fd3b5..35d0887 100644
a3470f
--- a/xlators/protocol/server/src/server-rpc-fops.c
a3470f
+++ b/xlators/protocol/server/src/server-rpc-fops.c
a3470f
@@ -5871,6 +5871,9 @@ server3_3_lookup (rpcsvc_request_t *req)
a3470f
         ret = 0;
a3470f
         resolve_and_resume (frame, server_lookup_resume);
a3470f
 
a3470f
+        free (args.bname);
a3470f
+        free (args.xdata.xdata_val);
a3470f
+
a3470f
         return ret;
a3470f
 out:
a3470f
         free (args.bname);
a3470f
-- 
a3470f
1.8.3.1
a3470f