From 580d91eb563e8d8a9eb11dbe1c285541c70dbe16 Mon Sep 17 00:00:00 2001 From: Ira Cooper Date: Fri, 24 Jan 2014 09:54:19 -0500 Subject: glusterd: Free leaked error message. The way the previous code was written you couldn't tell if the string was from the data area, or allocated, so we switched how the error message is printed, and now free unconditionally. Change-Id: Ia83cf9893acdfb5d537a61cc0bbf4aa7689e483d CID: 1124704 BUG: 789278 Signed-off-by: Ira Cooper Reviewed-on: http://review.gluster.org/6779 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/mgmt/glusterd/src/glusterd-op-sm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'xlators/mgmt/glusterd/src') diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 0ddb52b3a..963aa0762 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -1539,10 +1539,12 @@ glusterd_op_set_volume (dict_t *dict) if (dict_count == 0) { ret = glusterd_volset_help (NULL, &op_errstr); if (ret) { - op_errstr = (op_errstr)? op_errstr: - "Volume set help internal error"; - gf_log (this->name, GF_LOG_ERROR, "%s", op_errstr); + gf_log (this->name, GF_LOG_ERROR, "%s", + (op_errstr)? op_errstr: + "Volume set help internal error"); } + + GF_FREE(op_errstr); goto out; } -- cgit