summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2017-04-20 02:12:42 -0400
committerJeff Darcy <jeff@pl.atyp.us>2017-04-21 20:08:02 +0000
commit1e2f13fa89a5aef64cc9e5a229216820ed6e7556 (patch)
tree730765e2081bd6654b8073725534be7e1e96f96f
parentb5ebf8adf6127e052ac0dae42051a5f1f791343d (diff)
api: free all dynamic memory returned from xdr_to_generic
Change-Id: I01235ffca80683e69e99da09a9fc1a6d3ffdcb65 Signed-off-by: Kinglong Mee <mijinlong@open-fs.com> Reviewed-on: https://review.gluster.org/17090 Tested-by: Poornima G <pgurusid@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jeff@pl.atyp.us> Smoke: Gluster Build System <jenkins@build.gluster.org>
-rw-r--r--api/src/glfs-mgmt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/api/src/glfs-mgmt.c b/api/src/glfs-mgmt.c
index 1bfebcf2d03..b2728477ef7 100644
--- a/api/src/glfs-mgmt.c
+++ b/api/src/glfs-mgmt.c
@@ -382,7 +382,7 @@ out:
if (rsp.dict.dict_val)
free (rsp.dict.dict_val);
- if (rsp.op_errstr && *rsp.op_errstr)
+ if (rsp.op_errstr)
free (rsp.op_errstr);
gf_msg_debug (frame->this->name, 0, "Returning: %d", ret);
@@ -677,6 +677,9 @@ out:
if (rsp.spec)
free (rsp.spec);
+ if (rsp.xdata.xdata_val)
+ free (rsp.xdata.xdata_val);
+
// Stop if server is running at an unsupported op-version
if (ENOTSUP == ret) {
gf_msg ("mgmt", GF_LOG_ERROR, ENOTSUP, API_MSG_WRONG_OPVERSION,