Skip to content
Browse files

protocol: fix memory leak of lk-owner buffer in *lk() calls

Change-Id: I7fb0e1757c5e04b1a2609c9822ac79301808f671
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 768330
Reviewed-on: http://review.gluster.com/3244
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
  • Loading branch information...
1 parent a2ca310 commit c204e8c2713678e990b74c98f9eda8f18d714b3d @amarts amarts committed with avati Apr 29, 2012
Showing with 12 additions and 0 deletions.
  1. +3 −0 xlators/protocol/client/src/client3_1-fops.c
  2. +9 −0 xlators/protocol/server/src/server3_1-fops.c
View
3 xlators/protocol/client/src/client3_1-fops.c
@@ -2186,6 +2186,9 @@ client3_1_lk_cbk (struct rpc_req *req, struct iovec *iov, int count,
if (rsp.xdata.xdata_val)
free (rsp.xdata.xdata_val);
+ if (rsp.flock.lk_owner.lk_owner_val)
+ free (rsp.flock.lk_owner.lk_owner_val);
+
if (xdata)
dict_unref (xdata);
View
9 xlators/protocol/server/src/server3_1-fops.c
@@ -4866,6 +4866,9 @@ server_inodelk (rpcsvc_request_t *req)
if (args.xdata.xdata_val)
free (args.xdata.xdata_val);
+ if (args.flock.lk_owner.lk_owner_val)
+ free (args.flock.lk_owner.lk_owner_val);
+
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -4951,6 +4954,9 @@ server_finodelk (rpcsvc_request_t *req)
if (args.xdata.xdata_val)
free (args.xdata.xdata_val);
+ if (args.flock.lk_owner.lk_owner_val)
+ free (args.flock.lk_owner.lk_owner_val);
+
if (op_errno)
req->rpc_err = GARBAGE_ARGS;
@@ -5420,6 +5426,9 @@ server_lk (rpcsvc_request_t *req)
if (args.xdata.xdata_val)
free (args.xdata.xdata_val);
+ if (args.flock.lk_owner.lk_owner_val)
+ free (args.flock.lk_owner.lk_owner_val);
+
if (op_errno)
req->rpc_err = GARBAGE_ARGS;

0 comments on commit c204e8c

Please sign in to comment.
Something went wrong with that request. Please try again.