Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2024-04-01 23:01:18 +0000
committerTom Lane2024-04-01 23:01:36 +0000
commit3622c8084643cc05bc8f28d0b238615c845eae14 (patch)
treedac8c317c093892e08507f480d4e4d7c4ea5f5d1 /src/interfaces/libpq/fe-secure-openssl.c
parent3d0f730bf19fbc70cca58818c1ad7415e5aa7d62 (diff)
Avoid "unused variable" warning on non-USE_SSL_ENGINE platforms.
If we are building with openssl but USE_SSL_ENGINE didn't get set, initialize_SSL's variable "pkey" is declared but used nowhere. Apparently this combination hasn't been exercised in the buildfarm before now, because I've not seen this warning before, even though the code has been like this a long time. Move the declaration to silence the warning (and remove its useless initialization). Per buildfarm member sawshark. Back-patch to all supported branches.
Diffstat (limited to 'src/interfaces/libpq/fe-secure-openssl.c')
-rw-r--r--src/interfaces/libpq/fe-secure-openssl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/interfaces/libpq/fe-secure-openssl.c b/src/interfaces/libpq/fe-secure-openssl.c
index bf45a8edc31..0c8c9f8dcba 100644
--- a/src/interfaces/libpq/fe-secure-openssl.c
+++ b/src/interfaces/libpq/fe-secure-openssl.c
@@ -902,7 +902,6 @@ initialize_SSL(PGconn *conn)
bool have_homedir;
bool have_cert;
bool have_rootcert;
- EVP_PKEY *pkey = NULL;
/*
* We'll need the home directory if any of the relevant parameters are
@@ -1252,6 +1251,7 @@ initialize_SSL(PGconn *conn)
/* Colon, but not in second character, treat as engine:key */
char *engine_str = strdup(conn->sslkey);
char *engine_colon;
+ EVP_PKEY *pkey;
if (engine_str == NULL)
{