aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2024-04-01 19:01:18 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2024-04-01 19:01:18 -0400
commit98e427af9f59f2515ed67b97c64c9fec16fa7211 (patch)
tree809fceba41f3f6aaef60d43524993fb6bcae26de /src
parent08bdf0a4798bbbbc401bd951cd9553f3c6de2de7 (diff)
downloadpostgresql-98e427af9f59f2515ed67b97c64c9fec16fa7211.tar.gz
postgresql-98e427af9f59f2515ed67b97c64c9fec16fa7211.zip
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')
-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 c02caafd5f1..47c8e0b2029 100644
--- a/src/interfaces/libpq/fe-secure-openssl.c
+++ b/src/interfaces/libpq/fe-secure-openssl.c
@@ -909,7 +909,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
@@ -1245,6 +1244,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)
{