summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/protocol')
-rw-r--r--xlators/protocol/client/src/client3_1-fops.c2
-rw-r--r--xlators/protocol/legacy/server/src/server-protocol.c3
-rw-r--r--xlators/protocol/server/src/server-handshake.c3
-rw-r--r--xlators/protocol/server/src/server-helpers.c3
-rw-r--r--xlators/protocol/server/src/server-resolve.c4
5 files changed, 11 insertions, 4 deletions
diff --git a/xlators/protocol/client/src/client3_1-fops.c b/xlators/protocol/client/src/client3_1-fops.c
index 06b33348493..a007803b7c3 100644
--- a/xlators/protocol/client/src/client3_1-fops.c
+++ b/xlators/protocol/client/src/client3_1-fops.c
@@ -2080,7 +2080,7 @@ out:
GF_FREE (fdctx);
}
- if (ret)
+ if (ret && fr)
STACK_DESTROY (fr->root);
return ret;
diff --git a/xlators/protocol/legacy/server/src/server-protocol.c b/xlators/protocol/legacy/server/src/server-protocol.c
index 839c6a55745..e6c668d1567 100644
--- a/xlators/protocol/legacy/server/src/server-protocol.c
+++ b/xlators/protocol/legacy/server/src/server-protocol.c
@@ -4914,7 +4914,8 @@ _volfile_update_checksum (xlator_t *this, char *key, uint32_t checksum)
if (!temp_volfile) {
temp_volfile = GF_CALLOC (1, sizeof (struct _volfile_ctx),
gf_server_mt_volfile_ctx);
-
+ if (!temp_volfile)
+ goto out;
temp_volfile->next = conf->volfile;
temp_volfile->key = (key)? gf_strdup (key): NULL;
temp_volfile->checksum = checksum;
diff --git a/xlators/protocol/server/src/server-handshake.c b/xlators/protocol/server/src/server-handshake.c
index d386e9ce55b..f9a4bca364c 100644
--- a/xlators/protocol/server/src/server-handshake.c
+++ b/xlators/protocol/server/src/server-handshake.c
@@ -91,7 +91,8 @@ _volfile_update_checksum (xlator_t *this, char *key, uint32_t checksum)
if (!temp_volfile) {
temp_volfile = GF_CALLOC (1, sizeof (struct _volfile_ctx),
gf_server_mt_volfile_ctx_t);
-
+ if (!temp_volfile)
+ goto out;
temp_volfile->next = conf->volfile;
temp_volfile->key = (key)? gf_strdup (key): NULL;
temp_volfile->checksum = checksum;
diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c
index 37418ac1de4..84c66d1141d 100644
--- a/xlators/protocol/server/src/server-helpers.c
+++ b/xlators/protocol/server/src/server-helpers.c
@@ -684,6 +684,8 @@ server_connection_get (xlator_t *this, const char *id)
if (!conn) {
conn = (void *) GF_CALLOC (1, sizeof (*conn),
gf_server_mt_conn_t);
+ if (!conn)
+ goto unlock;
conn->id = gf_strdup (id);
conn->fdtable = gf_fd_fdtable_alloc ();
@@ -697,6 +699,7 @@ server_connection_get (xlator_t *this, const char *id)
conn->ref++;
conn->active_transports++;
}
+unlock:
pthread_mutex_unlock (&conf->mutex);
return conn;
diff --git a/xlators/protocol/server/src/server-resolve.c b/xlators/protocol/server/src/server-resolve.c
index 77336216f19..91cf0d96f30 100644
--- a/xlators/protocol/server/src/server-resolve.c
+++ b/xlators/protocol/server/src/server-resolve.c
@@ -75,6 +75,8 @@ prepare_components (call_frame_t *frame)
count = component_count (resolve->path);
components = GF_CALLOC (sizeof (*components), count,
gf_server_mt_resolv_comp_t);
+ if (!components)
+ goto out;
resolve->components = components;
components[0].basename = "";
@@ -90,7 +92,7 @@ prepare_components (call_frame_t *frame)
i++;
}
}
-
+out:
return 0;
}