From b20e6bcce248c286a6bfe6d540905dfc358dbc07 Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Fri, 31 Oct 2014 07:06:52 +0530 Subject: glusterd/geo-rep: Fix glusterd crash in non-originator slave node. Problem: glusterd crashes in non-originator slave node during geo-rep create push-pem. Cause: In glusterd_op_copy_file, the value of the key "common_pem_contents" is freed explicitly even after dict_set is successful when it is taken cared by dict_free. Solution: Free only in failure cases before dict_set. BUG: 1159210 Change-Id: I726f923915fc24de6588469c27f2cc996c20c59d Reviewed-On: http://review.gluster.org/9018/ Signed-off-by: Kotresh HR Reviewed-on: http://review.gluster.org/9026 Tested-by: Gluster Build System Reviewed-by: Venky Shankar Tested-by: Venky Shankar --- xlators/mgmt/glusterd/src/glusterd-geo-rep.c | 1 + 1 file changed, 1 insertion(+) (limited to 'xlators/mgmt/glusterd/src') diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c index 8496327443c..a88729c0e6a 100644 --- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c +++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c @@ -4383,6 +4383,7 @@ glusterd_op_copy_file (dict_t *dict, char **op_errstr) } free_contents = _gf_false; } else { + free_contents = _gf_false; ret = dict_get_bin (dict, "common_pem_contents", (void **) &contents); if (ret) { -- cgit