[dovecot-cvs] dovecot/src/login-common ssl-proxy-openssl.c, 1.54, 1.55

tss at dovecot.org tss at dovecot.org
Sun Mar 18 04:51:22 EET 2007


Update of /var/lib/cvs/dovecot/src/login-common
In directory talvi:/tmp/cvs-serv12497/login-common

Modified Files:
	ssl-proxy-openssl.c 
Log Message:
Make OpenSSL memory allocations go through system_clean_pool.



Index: ssl-proxy-openssl.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/login-common/ssl-proxy-openssl.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- ssl-proxy-openssl.c	18 Mar 2007 02:40:28 -0000	1.54
+++ ssl-proxy-openssl.c	18 Mar 2007 02:51:19 -0000	1.55
@@ -663,6 +663,21 @@
 	return ssl_proxies == NULL ? 0 : hash_size(ssl_proxies);
 }
 
+static void *ssl_clean_malloc(size_t size)
+{
+	return p_malloc(system_clean_pool, size);
+}
+
+static void *ssl_clean_realloc(void *ptr, size_t size)
+{
+	return p_realloc(system_clean_pool, ptr, (size_t)-1, size);
+}
+
+static void ssl_clean_free(void *ptr)
+{
+	return p_free(system_clean_pool, ptr);
+}
+
 void ssl_proxy_init(void)
 {
 	static char dovecot[] = "dovecot";
@@ -683,6 +698,8 @@
 		return;
 	}
 
+	CRYPTO_set_mem_functions(ssl_clean_malloc, ssl_clean_realloc,
+				 ssl_clean_free);
 	SSL_library_init();
 	SSL_load_error_strings();
 



More information about the dovecot-cvs mailing list