diff --git a/Gsm_SockInt_Open.c b/Gsm_SockInt_Open.c index 5a18d0b..2c52930 100755 --- a/Gsm_SockInt_Open.c +++ b/Gsm_SockInt_Open.c @@ -122,7 +122,7 @@ uint8_t Gsm_Socket_open(tSocketGsm *env, eSocketType type, char *addr, size_t ad void Gsm_Socket_close(tSocketGsm *env, uint8_t contextId) { if (osMutexAcquire(env->access, defaultSocketTimeout) == osOK) { - if (contextId != SOCKET_WRONG_CONTEXT) { + if ((contextId != SOCKET_WRONG_CONTEXT) && (contextId != 0)) { AtGsmTelitLe910_CloseConnection(env->gsmAt, contextId); GsmSocketSlot_Clear(env->slots + contextId); } else {