diff options
Diffstat (limited to 'xlators/protocol')
-rw-r--r-- | xlators/protocol/server/src/server-handshake.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/protocol/server/src/server-handshake.c b/xlators/protocol/server/src/server-handshake.c index 698c3f8579f..5f6b96792fa 100644 --- a/xlators/protocol/server/src/server-handshake.c +++ b/xlators/protocol/server/src/server-handshake.c @@ -929,8 +929,9 @@ fail: GF_ASSERT(rsp); rsp->op_ret = 0; - rsp->dict.dict_len = dict_serialized_length(reply); - if (rsp->dict.dict_len) { + ret = dict_serialized_length(reply); + if (ret > 0) { + rsp->dict.dict_len = ret; rsp->dict.dict_val = GF_CALLOC(1, rsp->dict.dict_len, gf_server_mt_rsp_buf_t); if (rsp->dict.dict_val) { |