summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2021-09-20 09:16:30 +0000
committerYann Ylavic <ylavic@apache.org>2021-09-20 09:16:30 +0000
commit9bfcf1e678c69ca5e2d734590e704346e6508468 (patch)
tree2fd666f5d2070b65ee427c3da4439466c9db1bc5 /crypto
parentd64a6c690f98bfb053b5540b76fbed77e085a921 (diff)
downloadapr-9bfcf1e678c69ca5e2d734590e704346e6508468.tar.gz
apr_crypto: non-DSO drivers should have global lifetime too.
Same lifetime as the hashtable used by apr_crypto_get_driver() to cache the drivers for reloads. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1893466 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'crypto')
-rw-r--r--crypto/apr_crypto.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c
index 478e3a4a7..7572a5904 100644
--- a/crypto/apr_crypto.c
+++ b/crypto/apr_crypto.c
@@ -215,8 +215,8 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver(
char symname[34];
apr_dso_handle_t *dso;
apr_dso_handle_sym_t symbol;
- apr_pool_t *rootp;
#endif
+ apr_pool_t *rootp;
apr_status_t rv;
if (result) {
@@ -237,11 +237,11 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver(
return APR_SUCCESS;
}
-#if APR_HAVE_MODULAR_DSO
- /* The driver DSO must have exactly the same lifetime as the
+ /* The driver must have exactly the same lifetime as the
* drivers hash table; ignore the passed-in pool */
rootp = apr_hash_pool_get(drivers);
+#if APR_HAVE_MODULAR_DSO
#if defined(NETWARE)
apr_snprintf(modname, sizeof(modname), "crypto%s.nlm", name);
#elif defined(WIN32) || defined(__CYGWIN__)
@@ -283,6 +283,8 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver(
#else /* not builtin and !APR_HAS_DSO => not implemented */
rv = APR_ENOTIMPL;
+ pool = rootp; /* global lifetime (aligned to hash table) */
+
/* Load statically-linked drivers: */
#if APU_HAVE_OPENSSL
if (!strcmp(name, "openssl")) {