diff options
author | Adrian Reber <adrian@lisas.de> | 2019-02-13 09:12:49 +0100 |
---|---|---|
committer | Adrian Reber <adrian@lisas.de> | 2019-02-13 09:13:03 +0100 |
commit | 5055f4fee07f3eac283b1ce9484713f2a394f4fb (patch) | |
tree | d9e5a9b7feb46cbdf96b211c7162288c924fd8bc /0001-Fix-memory-leak-when-creating-a-new-bdb-file-125.patch | |
parent | f4b8b6f1d01eadf54c12db9be4addfe8d28f8536 (diff) | |
download | bogofilter_EL6-5055f4fee07f3eac283b1ce9484713f2a394f4fb.tar.gz |
Applied 11 patches from Georg Sauthoff (#1676460)
Diffstat (limited to '0001-Fix-memory-leak-when-creating-a-new-bdb-file-125.patch')
-rw-r--r-- | 0001-Fix-memory-leak-when-creating-a-new-bdb-file-125.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/0001-Fix-memory-leak-when-creating-a-new-bdb-file-125.patch b/0001-Fix-memory-leak-when-creating-a-new-bdb-file-125.patch new file mode 100644 index 0000000..09087c3 --- /dev/null +++ b/0001-Fix-memory-leak-when-creating-a-new-bdb-file-125.patch @@ -0,0 +1,50 @@ +From 861b6c058b36fafefcdca21be180fa44046db4a0 Mon Sep 17 00:00:00 2001 +From: Georg Sauthoff <mail@georg.so> +Date: Mon, 11 Feb 2019 10:01:14 +0100 +Subject: [PATCH 01/11] Fix memory leak when creating a new bdb file (#125) + +cf. https://sourceforge.net/p/bogofilter/bugs/125/ +--- + src/datastore_db.c | 21 +++++++++++++++++++-- + 1 file changed, 19 insertions(+), 2 deletions(-) + +diff --git a/src/datastore_db.c b/src/datastore_db.c +index 4b58462..d0bcfa1 100644 +--- a/src/datastore_db.c ++++ b/src/datastore_db.c +@@ -630,13 +630,30 @@ retry_db_open: + if (ret != 0) { + err = (ret != ENOENT) || (opt_flags == DB_RDONLY); + if (!err) { +- if ( ++ ret = + #if DB_EQUAL(4,1) +- (ret = DB_SET_FLAGS(dbp, DB_CHKSUM_SHA1)) != 0 || ++ (DB_SET_FLAGS(dbp, DB_CHKSUM_SHA1)) != 0 || + #endif + #if DB_AT_LEAST(4,2) + (ret = DB_SET_FLAGS(dbp, DB_CHKSUM)) != 0 || + #endif ++ 0; ++ if (!ret) { ++ dbp->close(dbp, 0); ++ if ((ret = db_create (&dbp, dbe, 0)) != 0) { ++ print_error(__FILE__, __LINE__, "(db) db_create, err: %d, %s", ++ ret, db_strerror(ret)); ++ goto open_err; ++ } ++ handle->dbp = dbp; ++#ifdef ENABLE_MEMDEBUG ++ if (eTransaction == T_DISABLED) ++ dbp->set_alloc(dbp, md_malloc, md_realloc, md_free); ++ else ++ dbe->set_alloc(dbe, md_malloc, md_realloc, md_free); ++#endif ++ } ++ if (ret || + (ret = DB_OPEN(dbp, bfp, NULL, dbtype, opt_flags | DB_CREATE | DB_EXCL | retryflag, DS_MODE))) + err = true; + if (!err) +-- +2.20.1 + |