summaryrefslogtreecommitdiffstats
path: root/src/kiro-server.c
diff options
context:
space:
mode:
authorTimo Dritschler <timo.dritschler@kit.edu>2014-11-26 18:49:58 +0100
committerTimo Dritschler <timo.dritschler@kit.edu>2014-11-26 18:49:58 +0100
commit8df0836960547bbbf8e75a87efc45cd31d9f65c4 (patch)
tree0221e1a2b298a47e959905eaac00fadcb5f6490b /src/kiro-server.c
parent3dc2e76f0d6cf350f41c574726d354f1a81591a6 (diff)
parentfcec7a701ef599c432f29f13ce82bfdb464d7ee7 (diff)
downloadkiro-8df0836960547bbbf8e75a87efc45cd31d9f65c4.tar.gz
kiro-8df0836960547bbbf8e75a87efc45cd31d9f65c4.tar.bz2
kiro-8df0836960547bbbf8e75a87efc45cd31d9f65c4.tar.xz
kiro-8df0836960547bbbf8e75a87efc45cd31d9f65c4.zip
Merge branch 'master' into eventLoops
Diffstat (limited to 'src/kiro-server.c')
-rw-r--r--src/kiro-server.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/kiro-server.c b/src/kiro-server.c
index e4a5bb6..6e4b88a 100644
--- a/src/kiro-server.c
+++ b/src/kiro-server.c
@@ -127,7 +127,7 @@ connect_client (struct rdma_cm_id *client)
return -1;
}
- struct kiro_connection_context *ctx = (struct kiro_connection_context *)calloc (1, sizeof (struct kiro_connection_context));
+ struct kiro_connection_context *ctx = (struct kiro_connection_context *)g_try_malloc0 (sizeof (struct kiro_connection_context));
if (!ctx) {
g_critical ("Failed to create connection context");
@@ -170,7 +170,7 @@ static int
welcome_client (struct rdma_cm_id *client, void *mem, size_t mem_size)
{
struct kiro_connection_context *ctx = (struct kiro_connection_context *) (client->context);
- ctx->rdma_mr = (struct kiro_rdma_mem *)calloc (1, sizeof (struct kiro_rdma_mem));
+ ctx->rdma_mr = (struct kiro_rdma_mem *)g_try_malloc0 (sizeof (struct kiro_rdma_mem));
if (!ctx->rdma_mr) {
g_critical ("Failed to allocate RDMA Memory Container: %s", strerror (errno));
@@ -225,7 +225,7 @@ process_cm_event (GIOChannel *source, GIOCondition condition, gpointer data)
if (0 <= rdma_get_cm_event (priv->ec, &active_event)) {
//Disable cancellation to prevent undefined states during shutdown
- struct rdma_cm_event *ev = malloc (sizeof (*active_event));
+ struct rdma_cm_event *ev = g_try_malloc (sizeof (*active_event));
if (!ev) {
g_critical ("Unable to allocate memory for Event handling!");
@@ -276,7 +276,7 @@ process_cm_event (GIOChannel *source, GIOCondition condition, gpointer data)
g_debug ("Connection closed successfully. %u connected clients remaining", g_list_length (priv->clients));
}
- free (ev);
+ g_free (ev);
}
return TRUE;
}