From 4e858e3859831bbc023316e410a9055da6ce5790 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 12 Aug 2011 13:40:09 +0000 Subject: [PATCH] * modules/ssl/ssl_engine_config.c (ssl_cmd_SSLCryptoDevice): Fix 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 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/ssl/ssl_engine_config.c b/modules/ssl/ssl_engine_config.c index 918f9216d7..fee529d0b6 100644 --- a/modules/ssl/ssl_engine_config.c +++ b/modules/ssl/ssl_engine_config.c @@ -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; } -- 2.40.0