oauth: Simplify copy of PGoauthBearerRequest
authorThomas Munro <tmunro@postgresql.org>
Wed, 19 Mar 2025 03:58:48 +0000 (16:58 +1300)
committerThomas Munro <tmunro@postgresql.org>
Wed, 19 Mar 2025 03:59:25 +0000 (16:59 +1300)
Follow-up to 03366b61d. Since there are no more const members in the
PGoauthBearerRequest struct, the previous memcpy() can be replaced with
simple assignment.

Author: Jacob Champion <jacob.champion@enterprisedb.com>
Discussion: https://postgr.es/m/p4bd7mn6dxr2zdak74abocyltpfdxif4pxqzixqpxpetjwt34h%40qc6jgfmoddvq

src/interfaces/libpq/fe-auth-oauth.c

index fb1e9a1a8aafb6309c7a7fec8ccc18d4e4bd70e6..cf1a25e2ccc7d80f7a3c564a6411d37c36036184 100644 (file)
@@ -781,7 +781,7 @@ setup_token_request(PGconn *conn, fe_oauth_state *state)
            goto fail;
        }
 
-       memcpy(request_copy, &request, sizeof(request));
+       *request_copy = request;
 
        conn->async_auth = run_user_oauth_flow;
        conn->cleanup_async_auth = cleanup_user_oauth_flow;