From 54558cfc3653d5b5201ec7fd45594cb610eefbca Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Thu, 7 Apr 2011 21:11:15 +0000 Subject: mgmt/glusterd: serialize the dict only if its not NULL Signed-off-by: Pranith Kumar K Signed-off-by: Vijay Bellur BUG: 2691 ([glusterfs-3.2.0qa9]: glusterd error) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2691 --- xlators/mgmt/glusterd/src/glusterd-handler.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'xlators/mgmt/glusterd/src') diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 0a43ef9b6aa..5351d4a9d66 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -2619,13 +2619,15 @@ glusterd_op_commit_send_resp (rpcsvc_request_t *req, else rsp.op_errstr = ""; - ret = dict_allocate_and_serialize (rsp_dict, - &rsp.dict.dict_val, - (size_t *)&rsp.dict.dict_len); - if (ret < 0) { - gf_log ("", GF_LOG_DEBUG, - "failed to get serialized length of dict"); - goto out; + if (rsp_dict) { + ret = dict_allocate_and_serialize (rsp_dict, + &rsp.dict.dict_val, + (size_t *)&rsp.dict.dict_len); + if (ret < 0) { + gf_log ("", GF_LOG_DEBUG, + "failed to get serialized length of dict"); + goto out; + } } -- cgit