]> granicus.if.org Git - apache/commitdiff
* modules/ssl/ssl_engine_config.c (ssl_cmd_SSLCryptoDevice): Fix
authorJoe Orton <jorton@apache.org>
Fri, 12 Aug 2011 13:40:09 +0000 (13:40 +0000)
committerJoe Orton <jorton@apache.org>
Fri, 12 Aug 2011 13:40:09 +0000 (13:40 +0000)
  double-free (and segfault) with bad arg to SSLCryptoDevice.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1157105 13f79535-47bb-0310-9956-ffa450edef68

modules/ssl/ssl_engine_config.c

index 918f9216d77e895845a64c5a560ec49ebd05ef99..fee529d0b623232c7d8cda43f58a5e662666b510 100644 (file)
@@ -461,12 +461,11 @@ const char *ssl_cmd_SSLCryptoDevice(cmd_parms *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;
     }