summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Orton <jorton@apache.org>2011-08-12 15:40:09 +0200
committerJoe Orton <jorton@apache.org>2011-08-12 15:40:09 +0200
commit4e858e3859831bbc023316e410a9055da6ce5790 (patch)
treebdbbf1ce06160a9898267688141bf83aa3059610
parent* modules/proxy/config.m4: Avoid sh syntax error with (diff)
downloadapache2-4e858e3859831bbc023316e410a9055da6ce5790.tar.xz
apache2-4e858e3859831bbc023316e410a9055da6ce5790.zip
* 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
-rw-r--r--modules/ssl/ssl_engine_config.c7
1 files 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;
}