summaryrefslogtreecommitdiffstatsabout
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gnutls_cache.c9
-rw-r--r--src/mod_gnutls.c1
2 files changed, 8 insertions, 2 deletions
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 @@
1/** 1/**
2 * Copyright 2004-2005 Paul Querna 2 * Copyright 2004-2005 Paul Querna
3 * Portions Copyright 2008 Nikos Mavrogiannopoulos
3 * 4 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 6 * 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)
345 break; 346 break;
346 } 347 }
347 } 348 }
349 apr_dbm_freedatum( dbm, dbmval);
348 350
349 } 351 }
350 apr_dbm_nextkey(dbm, &dbmkey); 352 apr_dbm_nextkey(dbm, &dbmkey);
@@ -401,20 +403,25 @@ static gnutls_datum_t dbm_cache_fetch(void* baton, gnutls_datum_t key)
401 } 403 }
402 404
403 if (dbmval.dptr == NULL || dbmval.dsize <= sizeof(apr_time_t)) { 405 if (dbmval.dptr == NULL || dbmval.dsize <= sizeof(apr_time_t)) {
406 apr_dbm_freedatum( dbm, dbmval);
404 apr_dbm_close(dbm); 407 apr_dbm_close(dbm);
405 return data; 408 return data;
406 } 409 }
407 apr_dbm_close(dbm);
408 410
409 data.size = dbmval.dsize - sizeof(apr_time_t); 411 data.size = dbmval.dsize - sizeof(apr_time_t);
410 412
411 data.data = gnutls_malloc(data.size); 413 data.data = gnutls_malloc(data.size);
412 if (data.data == NULL) { 414 if (data.data == NULL) {
415 apr_dbm_freedatum( dbm, dbmval);
416 apr_dbm_close(dbm);
413 return data; 417 return data;
414 } 418 }
415 419
416 memcpy(data.data, dbmval.dptr+sizeof(apr_time_t), data.size); 420 memcpy(data.data, dbmval.dptr+sizeof(apr_time_t), data.size);
417 421
422 apr_dbm_freedatum( dbm, dbmval);
423 apr_dbm_close(dbm);
424
418 return data; 425 return data;
419} 426}
420 427
diff --git a/src/mod_gnutls.c b/src/mod_gnutls.c
index 5207641..08e7dba 100644
--- a/src/mod_gnutls.c
+++ b/src/mod_gnutls.c
@@ -17,7 +17,6 @@
17 17
18#include "mod_gnutls.h" 18#include "mod_gnutls.h"
19 19
20
21static void gnutls_hooks(apr_pool_t * p) 20static void gnutls_hooks(apr_pool_t * p)
22{ 21{
23 ap_hook_pre_connection(mgs_hook_pre_connection, NULL, NULL, 22 ap_hook_pre_connection(mgs_hook_pre_connection, NULL, NULL,