From: Lukas Slebodnik Date: Sat, 21 Oct 2017 13:09:01 +0000 (+0200) Subject: ldb: Fix memory leak on module context X-Git-Tag: ldb-1.3.4~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fb72464150bb64effa79a2c07b83f7167e1b75b;p=thirdparty%2Fsamba.git ldb: Fix memory leak on module context Introduced in e8cdacc509016d9273d63faf334d9f827585c3eb BUG: https://bugzilla.samba.org/show_bug.cgi?id=13459 Signed-off-by: Lukas Slebodnik Reviewed-by: Andrew Bartlett Reviewed-by: Garming Sam Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Fri Jun 1 11:10:24 CEST 2018 on sn-devel-144 (cherry picked from commit d161aa3522576545d269208426bb0014ee2ab35f) --- diff --git a/lib/ldb/ldb_tdb/ldb_index.c b/lib/ldb/ldb_tdb/ldb_index.c index 251f6295f54..290d9b6482b 100644 --- a/lib/ldb/ldb_tdb/ldb_index.c +++ b/lib/ldb/ldb_tdb/ldb_index.c @@ -523,9 +523,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; }