ldb: Fix memory leak on module context
authorLukas Slebodnik <lslebodn@fedoraproject.org>
Sat, 21 Oct 2017 13:09:01 +0000 (15:09 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 1 Jun 2018 09:10:24 +0000 (11:10 +0200)
Introduced in e8cdacc509016d9273d63faf334d9f827585c3eb

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13459

Signed-off-by: Lukas Slebodnik <lslebodn@fedoraproject.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Jun  1 11:10:24 CEST 2018 on sn-devel-144

lib/ldb/ldb_tdb/ldb_index.c

index 7bd843e..04ffbad 100644 (file)
@@ -612,9 +612,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;
        }