summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--transport/socket/src/socket.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/transport/socket/src/socket.c b/transport/socket/src/socket.c
index 151ce3c9350..e2691500b9f 100644
--- a/transport/socket/src/socket.c
+++ b/transport/socket/src/socket.c
@@ -299,6 +299,8 @@ __socket_ioq_new (transport_t *this, char *buf, int len,
/* TODO: use mem-pool */
entry = CALLOC (1, sizeof (*entry));
+ if (!entry)
+ return NULL;
assert (count <= (MAX_IOVEC-2));
@@ -1329,6 +1331,8 @@ socket_submit (transport_t *this, char *buf, int len,
priv->submit_log = 0;
entry = __socket_ioq_new (this, buf, len, vector, count, iobref);
+ if (!entry)
+ goto unlock;
if (list_empty (&priv->ioq)) {
ret = __socket_ioq_churn_entry (this, entry);