summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshishir gowda <sgowda@redhat.com>2013-10-25 12:05:01 +0530
committershishir gowda <sgowda@redhat.com>2013-11-15 14:39:42 +0530
commit2123e83976b1ca77bb253cabda3092e79c406145 (patch)
tree8ae5fb483d6ac3a3eaa51cb3cd314e0302d1b576
parent3a7644605bdd004348bbd8c0b797eaebbc10ae34 (diff)
mgmt/glusterd: Fix glusterd crash due to extra unref
Change-Id: I9d600b4d971b7fdcd54da50e4a069eab19648fa6 Original-author: Rajesh Joseph <rajeshatredhat@redhat.com> Signed-off-by: shishir gowda <sgowda@redhat.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
index c109496..f8ce8a6 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
@@ -2277,8 +2277,11 @@ glusterd_handle_snapshot_fn (rpcsvc_request_t *req)
goto out;
}
ret = dict_set_dynstr (dict, "host-uuid", host_uuid);
- if (ret)
+ if (ret) {
+ GF_FREE (host_uuid);
goto out;
+ }
+
} else {
gf_log (this->name, GF_LOG_ERROR, "request dict length is %d",
@@ -2320,7 +2323,6 @@ glusterd_handle_snapshot_fn (rpcsvc_request_t *req)
out:
if (ret) {
- GF_FREE (host_uuid);
if (err_str[0] == '\0')
snprintf (err_str, sizeof (err_str),
"Operation failed");