From 6af7973b0916372dc9f3c66d18b747d7d7147640 Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Fri, 1 Feb 2019 15:43:40 +0100 Subject: [PATCH] - IsoClientConnection_associateAsync: added check if socket creation has been successful --- src/mms/iso_client/iso_client_connection.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mms/iso_client/iso_client_connection.c b/src/mms/iso_client/iso_client_connection.c index e8f6aab4..72a203e2 100644 --- a/src/mms/iso_client/iso_client_connection.c +++ b/src/mms/iso_client/iso_client_connection.c @@ -636,6 +636,11 @@ IsoClientConnection_handleConnection(IsoClientConnection self) bool IsoClientConnection_associateAsync(IsoClientConnection self, uint32_t connectTimeoutInMs) { + self->socket = TcpSocket_create(); + + if (self->socket == NULL) + return false; + bool success = true; /* Create socket and start connect */ @@ -643,8 +648,6 @@ IsoClientConnection_associateAsync(IsoClientConnection self, uint32_t connectTim Semaphore_wait(self->tickMutex); - self->socket = TcpSocket_create(); - #if (CONFIG_ACTIVATE_TCP_KEEPALIVE == 1) Socket_activateTcpKeepAlive(self->socket, CONFIG_TCP_KEEPALIVE_IDLE,