]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4-dsdb: Ensure we always free tmp_ctx in schema refresh check
authorAndrew Bartlett <abartlet@samba.org>
Fri, 17 Aug 2012 02:42:15 +0000 (12:42 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 17 Aug 2012 04:21:17 +0000 (06:21 +0200)
This was found based on a log provided by Ricky Nance
<ricky.nance@weaubleau.k12.mo.us>.  Thanks Ricky!

In that log, over 2.5 days this particular allocation was repeated:

1715099     talloc_new: ../source4/dsdb/samdb/ldb_modules/schema_load.c:120 contains      0 bytes in   1 blocks

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Aug 17 06:21:18 CEST 2012 on sn-devel-104

source4/dsdb/samdb/ldb_modules/schema_load.c

index 82ae7d84dd37778886c532691e5aec940e30f38c..be7915e03cba995b1de64c0502692a09b6755e85 100644 (file)
@@ -131,8 +131,10 @@ static int schema_metadata_get_uint64(struct ldb_module *module,
        if (!tdb_data.dptr) {
                if (tdb_error(tdb) == TDB_ERR_NOEXIST) {
                        *value = default_value;
+                       talloc_free(tmp_ctx);
                        return LDB_SUCCESS;
                } else {
+                       talloc_free(tmp_ctx);
                        return ldb_module_error(module, LDB_ERR_OPERATIONS_ERROR,
                                                tdb_errorstr_compat(tdb));
                }