summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src/server-handshake.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/protocol/server/src/server-handshake.c')
-rw-r--r--xlators/protocol/server/src/server-handshake.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/xlators/protocol/server/src/server-handshake.c b/xlators/protocol/server/src/server-handshake.c
index dda58b6..6e584a7 100644
--- a/xlators/protocol/server/src/server-handshake.c
+++ b/xlators/protocol/server/src/server-handshake.c
@@ -240,7 +240,6 @@ server_setvolume(rpcsvc_request_t *req)
int32_t ret = -1;
int32_t op_ret = -1;
int32_t op_errno = EINVAL;
- char *buf = NULL;
uint32_t opversion = 0;
rpc_transport_t *xprt = NULL;
int32_t fop_version = 0;
@@ -267,18 +266,11 @@ server_setvolume(rpcsvc_request_t *req)
*/
config_params = dict_copy_with_ref(this->options, NULL);
- buf = gf_memdup(args.dict.dict_val, args.dict.dict_len);
- if (buf == NULL) {
- op_ret = -1;
- op_errno = ENOMEM;
- goto fail;
- }
-
- ret = dict_unserialize(buf, args.dict.dict_len, &params);
+ ret = dict_unserialize(args.dict.dict_val, args.dict.dict_len, &params);
if (ret < 0) {
- ret = dict_set_str(reply, "ERROR",
- "Internal error: failed to unserialize "
- "request dictionary");
+ ret = dict_set_sizen_str_sizen(reply, "ERROR",
+ "Internal error: failed to unserialize "
+ "request dictionary");
if (ret < 0)
gf_msg_debug(this->name, 0,
"failed to set error "
@@ -291,9 +283,6 @@ server_setvolume(rpcsvc_request_t *req)
goto fail;
}
- params->extra_free = buf;
- buf = NULL;
-
ret = dict_get_str(params, "remote-subvolume", &name);
if (ret < 0) {
ret = dict_set_str(reply, "ERROR",
@@ -727,8 +716,6 @@ fail:
dict_unref(config_params);
}
- GF_FREE(buf);
-
return 0;
}