summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-mountbroker.c2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-replace-brick.c6
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-sm.c3
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.c4
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c12
5 files changed, 15 insertions, 12 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-mountbroker.c b/xlators/mgmt/glusterd/src/glusterd-mountbroker.c
index 0d67d130360..c96804a80b4 100644
--- a/xlators/mgmt/glusterd/src/glusterd-mountbroker.c
+++ b/xlators/mgmt/glusterd/src/glusterd-mountbroker.c
@@ -671,7 +671,7 @@ glusterd_do_mount (char *label, dict_t *argdict, char **path, int *op_errno)
ret = -1;
gf_log ("", GF_LOG_WARNING, "unsuccessful mount request (%s)",
strerror (*op_errno));
- if (mtptemp) {
+ if (mtptemp && cookieswitch) {
*cookieswitch = '/';
unlink (mtptemp);
*cookieswitch = '\0';
diff --git a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
index 5f299a7eff5..da02edd3674 100644
--- a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
+++ b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
@@ -891,7 +891,7 @@ rb_generate_client_volfile (glusterd_volinfo_t *volinfo,
"%s", strerror (errno));
goto out;
}
- close (fd);
+ sys_close (fd);
file = fopen (filename, "w+");
if (!file) {
@@ -906,6 +906,7 @@ rb_generate_client_volfile (glusterd_volinfo_t *volinfo,
ttype = glusterd_get_trans_type_rb (volinfo->transport_type);
if (NULL == ttype){
ret = -1;
+ fclose (file);
goto out;
}
@@ -970,7 +971,7 @@ rb_generate_dst_brick_volfile (glusterd_volinfo_t *volinfo,
"%s", strerror (errno));
goto out;
}
- close (fd);
+ sys_close (fd);
file = fopen (filename, "w+");
if (!file) {
@@ -983,6 +984,7 @@ rb_generate_dst_brick_volfile (glusterd_volinfo_t *volinfo,
trans_type = glusterd_get_trans_type_rb (volinfo->transport_type);
if (NULL == trans_type){
ret = -1;
+ fclose (file);
goto out;
}
diff --git a/xlators/mgmt/glusterd/src/glusterd-sm.c b/xlators/mgmt/glusterd/src/glusterd-sm.c
index c2bf493004a..8d9c5215fa9 100644
--- a/xlators/mgmt/glusterd/src/glusterd-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-sm.c
@@ -245,7 +245,8 @@ glusterd_ac_reverse_probe_begin (glusterd_friend_sm_event_t *event, void *ctx)
out:
if (ret) {
GF_FREE (new_event);
- GF_FREE (new_ev_ctx->hostname);
+ if (new_ev_ctx)
+ GF_FREE (new_ev_ctx->hostname);
GF_FREE (new_ev_ctx);
}
gf_log ("", GF_LOG_DEBUG, "returning with %d", ret);
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
index 1790c5aec24..023fdc62f65 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
@@ -1247,10 +1247,10 @@ glusterd_store_global_info (xlator_t *this)
ret = gf_store_rename_tmppath (handle);
out:
- if (ret && (handle->fd > 0))
+ if (ret && handle && (handle->fd > 0))
gf_store_unlink_tmppath (handle);
- if (handle->fd > 0) {
+ if (handle && handle->fd > 0) {
close (handle->fd);
handle->fd = 0;
}
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index c336337e866..6706cb6f36c 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -4240,14 +4240,14 @@ glusterd_brick_start (glusterd_volinfo_t *volinfo,
xlator_t *this = NULL;
glusterd_conf_t *conf = NULL;
- if ((!brickinfo) || (!volinfo))
- goto out;
-
this = THIS;
GF_ASSERT (this);
conf = this->private;
GF_ASSERT (conf);
+ if ((!brickinfo) || (!volinfo))
+ goto out;
+
if (uuid_is_null (brickinfo->uuid)) {
ret = glusterd_resolve_brick (brickinfo);
if (ret) {
@@ -5074,14 +5074,14 @@ glusterd_brick_stop (glusterd_volinfo_t *volinfo,
xlator_t *this = NULL;
glusterd_conf_t *conf = NULL;
- if ((!brickinfo) || (!volinfo))
- goto out;
-
this = THIS;
GF_ASSERT (this);
conf = this->private;
GF_ASSERT (conf);
+ if ((!brickinfo) || (!volinfo))
+ goto out;
+
if (uuid_is_null (brickinfo->uuid)) {
ret = glusterd_resolve_brick (brickinfo);
if (ret) {