apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject svn commit: r1308088 - in /apr/apr-util/branches/1.5.x: ./ crypto/apr_crypto.c
Date Sun, 01 Apr 2012 12:03:32 GMT
Author: minfrin
Date: Sun Apr  1 12:03:32 2012
New Revision: 1308088

URL: http://svn.apache.org/viewvc?rev=1308088&view=rev
Log:
Backport:
apr_crypto: Ensure the *driver variable is initialised when the library
has already been loaded. Fix ported from apr_dbd.

Modified:
    apr/apr-util/branches/1.5.x/   (props changed)
    apr/apr-util/branches/1.5.x/crypto/apr_crypto.c

Propchange: apr/apr-util/branches/1.5.x/
------------------------------------------------------------------------------
  Merged /apr/apr/trunk:r1308087

Modified: apr/apr-util/branches/1.5.x/crypto/apr_crypto.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/crypto/apr_crypto.c?rev=1308088&r1=1308087&r2=1308088&view=diff
==============================================================================
--- apr/apr-util/branches/1.5.x/crypto/apr_crypto.c (original)
+++ apr/apr-util/branches/1.5.x/crypto/apr_crypto.c Sun Apr  1 12:03:32 2012
@@ -184,24 +184,16 @@ APU_DECLARE(apr_status_t) apr_crypto_get
 #endif
     apr_snprintf(symname, sizeof(symname), "apr_crypto_%s_driver", name);
     rv = apu_dso_load(&dso, &symbol, modname, symname, pool);
-    if (rv != APR_SUCCESS) { /* APR_EDSOOPEN or APR_ESYMNOTFOUND? */
-        if (rv == APR_EINIT) { /* previously loaded?!? */
-            name = apr_pstrdup(pool, name);
-            apr_hash_set(drivers, name, APR_HASH_KEY_STRING, *driver);
-            rv = APR_SUCCESS;
-        }
-        goto unlock;
-    }
-    *driver = symbol;
-    if ((*driver)->init) {
-        rv = (*driver)->init(pool, params, result);
-    }
-    if (rv == APR_SUCCESS) {
+    if (rv == APR_SUCCESS || rv == APR_EINIT) { /* previously loaded?!? */
+        *driver = symbol;
         name = apr_pstrdup(pool, name);
         apr_hash_set(drivers, name, APR_HASH_KEY_STRING, *driver);
+        rv = APR_SUCCESS;
+        if ((*driver)->init) {
+            rv = (*driver)->init(pool, params, result);
+        }
     }
-
-    unlock: apu_dso_mutex_unlock();
+    apu_dso_mutex_unlock();
 
     if (APR_SUCCESS != rv && result && !*result) {
         char *buffer = apr_pcalloc(pool, ERROR_SIZE);



Mime
View raw message