Merge "added validity check for connection handle if connection handle is null, then...
authorJaehyun Kim <jeik01.kim@samsung.com>
Fri, 28 Aug 2020 14:14:40 +0000 (14:14 +0000)
committerGerrit Code Review <gerrit@review>
Fri, 28 Aug 2020 14:14:40 +0000 (14:14 +0000)
src/connection.c

index 8b9f3a7..d9d1492 100755 (executable)
@@ -239,6 +239,14 @@ EXPORT_API int connection_destroy_cs(int tid, connection_h connection)
        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;