diff -ur openssl-1.0.1.orig/crypto/x509/x509_lu.c openssl-1.0.1/crypto/x509/x509_lu.c
--- openssl-1.0.1.orig/crypto/x509/x509_lu.c	2010-02-19 19:26:23.000000000 +0100
+++ openssl-1.0.1/crypto/x509/x509_lu.c	2012-04-16 10:39:42.974796711 +0200
@@ -82,12 +82,16 @@
 	return ret;
 	}
 
+void _free_dbg(void* p, int n)
+	{
+	}
+
 void X509_LOOKUP_free(X509_LOOKUP *ctx)
 	{
 	if (ctx == NULL) return;
 	if (	(ctx->method != NULL) &&
 		(ctx->method->free != NULL))
-		ctx->method->free(ctx);
+		(ctx->method->free)(ctx);
 	OPENSSL_free(ctx);
 	}
 
diff -ur openssl-1.0.1.orig/crypto/x509/x509_vfy.h openssl-1.0.1/crypto/x509/x509_vfy.h
--- openssl-1.0.1.orig/crypto/x509/x509_vfy.h	2009-10-31 20:21:47.000000000 +0100
+++ openssl-1.0.1/crypto/x509/x509_vfy.h	2012-04-16 10:28:04.346769956 +0200
@@ -137,6 +137,10 @@
 DECLARE_STACK_OF(X509_LOOKUP)
 DECLARE_STACK_OF(X509_OBJECT)
 
+void _free_dbg(void* p, int n);
+#define   _NORMAL_BLOCK         100
+#define   free(p)               _free_dbg(p, _NORMAL_BLOCK)
+
 /* This is a static that defines the function interface */
 typedef struct x509_lookup_method_st
 	{
