if connection handle is null, then _connection_unset_cs_tid() will be crash.
Change-Id: Iaba3160becf7b15ea9cec3127e00f1245c767229
int rv;
CONN_LOCK;
+
+ if (!(__connection_check_handle_validity(connection))) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ CONN_UNLOCK;
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ CONNECTION_LOG(CONNECTION_INFO, "Destroy connection handle: %p", connection);
_connection_unset_cs_tid(tid, connection);
CONN_UNLOCK;