summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2011-04-07 21:11:15 +0000
committerVijay Bellur <vijay@gluster.com>2011-04-07 23:35:27 -0700
commit54558cfc3653d5b5201ec7fd45594cb610eefbca (patch)
tree5fa1b699c0e19675cae8998ea18f75d4aef9cfa7
parent56814fefa0a4cff5d08528aa9103e01350d0e53a (diff)
mgmt/glusterd: serialize the dict only if its not NULL
Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Vijay Bellur <vijay@gluster.com> BUG: 2691 ([glusterfs-3.2.0qa9]: glusterd error) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2691
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 0a43ef9b6..5351d4a9d 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;
+ }
}