You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jo...@apache.org on 2011/08/12 15:40:09 UTC

svn commit: r1157105 - /httpd/httpd/trunk/modules/ssl/ssl_engine_config.c

Author: jorton
Date: Fri Aug 12 13:40:09 2011
New Revision: 1157105

URL: http://svn.apache.org/viewvc?rev=1157105&view=rev
Log:
* modules/ssl/ssl_engine_config.c (ssl_cmd_SSLCryptoDevice): Fix
  double-free (and segfault) with bad arg to SSLCryptoDevice.

Modified:
    httpd/httpd/trunk/modules/ssl/ssl_engine_config.c

Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_config.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_engine_config.c?rev=1157105&r1=1157104&r2=1157105&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_engine_config.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_engine_config.c Fri Aug 12 13:40:09 2011
@@ -461,12 +461,11 @@ const char *ssl_cmd_SSLCryptoDevice(cmd_
               "'builtin' (none)";
         e = ENGINE_get_first();
         while (e) {
-            ENGINE *en;
             err = apr_pstrcat(cmd->pool, err, ", '", ENGINE_get_id(e),
                                          "' (", ENGINE_get_name(e), ")", NULL);
-            en = ENGINE_get_next(e);
-            ENGINE_free(e);
-            e = en;
+            /* Iterate; this call implicitly decrements the refcount
+             * on the 'old' e, per the docs in engine.h. */
+            e = ENGINE_get_next(e);
         }
         return err;
     }