From 4fd6f509964f164e328cda0d52816b26bd05f9f3 Mon Sep 17 00:00:00 2001 From: Nokis Mavrogiannopoulos Date: Mon, 3 Mar 2008 13:59:47 +0000 Subject: corrected SRP enable flag, and corrected the DBM hook support. It now free data needed by some DBM providers. --- src/gnutls_cache.c | 9 ++++++++- src/mod_gnutls.c | 1 - 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gnutls_cache.c b/src/gnutls_cache.c index 83e7bb5..90f5a86 100644 --- a/src/gnutls_cache.c +++ b/src/gnutls_cache.c @@ -1,5 +1,6 @@ /** * Copyright 2004-2005 Paul Querna + * Portions Copyright 2008 Nikos Mavrogiannopoulos * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -345,6 +346,7 @@ static int dbm_cache_expire(mgs_handle_t *ctxt) break; } } + apr_dbm_freedatum( dbm, dbmval); } apr_dbm_nextkey(dbm, &dbmkey); @@ -401,20 +403,25 @@ static gnutls_datum_t dbm_cache_fetch(void* baton, gnutls_datum_t key) } if (dbmval.dptr == NULL || dbmval.dsize <= sizeof(apr_time_t)) { + apr_dbm_freedatum( dbm, dbmval); apr_dbm_close(dbm); return data; } - apr_dbm_close(dbm); data.size = dbmval.dsize - sizeof(apr_time_t); data.data = gnutls_malloc(data.size); if (data.data == NULL) { + apr_dbm_freedatum( dbm, dbmval); + apr_dbm_close(dbm); return data; } memcpy(data.data, dbmval.dptr+sizeof(apr_time_t), data.size); + apr_dbm_freedatum( dbm, dbmval); + apr_dbm_close(dbm); + return data; } diff --git a/src/mod_gnutls.c b/src/mod_gnutls.c index a8363fe..cc760e6 100644 --- a/src/mod_gnutls.c +++ b/src/mod_gnutls.c @@ -17,7 +17,6 @@ #include "mod_gnutls.h" - static void gnutls_hooks(apr_pool_t * p) { ap_hook_pre_connection(mgs_hook_pre_connection, NULL, NULL, -- cgit