From df8cc6a1d9e2bb5296a46287ce03390b1201e5da Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Sat, 21 Oct 2017 15:59:07 +0200 Subject: [PATCH] Fix memory leak introduced in 1.3.0 --- ...db-Fix-memory-leak-on-module-context.patch | 29 +++++++++++++++++++ libldb.spec | 7 ++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 0001-ldb-Fix-memory-leak-on-module-context.patch diff --git a/0001-ldb-Fix-memory-leak-on-module-context.patch b/0001-ldb-Fix-memory-leak-on-module-context.patch new file mode 100644 index 0000000..0eadfcc --- /dev/null +++ b/0001-ldb-Fix-memory-leak-on-module-context.patch @@ -0,0 +1,29 @@ +From 6c78935344a4f086fc209d0bd77feac0ea5894b3 Mon Sep 17 00:00:00 2001 +From: Lukas Slebodnik +Date: Sat, 21 Oct 2017 15:09:01 +0200 +Subject: [PATCH] ldb: Fix memory leak on module context + +Introduced in e8cdacc509016d9273d63faf334d9f827585c3eb +--- + lib/ldb/ldb_tdb/ldb_index.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/ldb/ldb_tdb/ldb_index.c b/lib/ldb/ldb_tdb/ldb_index.c +index c71e866037c5cccba151bcd2346460de0424fe18..1d69ab27f20e0a367c982134ff16a06b044a0c8e 100644 +--- a/lib/ldb/ldb_tdb/ldb_index.c ++++ b/lib/ldb/ldb_tdb/ldb_index.c +@@ -516,9 +516,9 @@ static int ltdb_dn_list_store_full(struct ldb_module *module, + if (list->count == 0) { + ret = ltdb_delete_noindex(module, msg); + if (ret == LDB_ERR_NO_SUCH_OBJECT) { +- talloc_free(msg); +- return LDB_SUCCESS; ++ ret = LDB_SUCCESS; + } ++ talloc_free(msg); + return ret; + } + +-- +2.14.2 + diff --git a/libldb.spec b/libldb.spec index 8f9965b..0918f12 100644 --- a/libldb.spec +++ b/libldb.spec @@ -14,7 +14,7 @@ Name: libldb Version: 1.3.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A schema-less, ldap like, API and database Requires: libtalloc%{?_isa} >= %{talloc_version} Requires: libtdb%{?_isa} >= %{tdb_version} @@ -47,6 +47,7 @@ BuildRequires: python3-tevent %endif # Patches +Patch0001: 0001-ldb-Fix-memory-leak-on-module-context.patch %description An extensible library that implements an LDAP like API to access remote LDAP @@ -132,6 +133,7 @@ Development files for the Python bindings for the LDB library %prep %setup -q -n ldb-%{version} +%patch0001 -p3 %build @@ -243,6 +245,9 @@ rm -f $RPM_BUILD_ROOT/%{_mandir}/man3/_* %endif %changelog +* Sat Oct 21 2017 Lukas Slebodnik - 1.3.0-2 +- Fix memory leak introduced in 1.3.0 + * Fri Oct 20 2017 Lukas Slebodnik - 1.3.0 - New upstream release 1.3.0 - Resolves: rhbz#1504361 - libldb-1.3.0 is available