diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-07-01 16:35:12 +0200 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-07-01 16:35:12 +0200 |
commit | 21c215512661907832570d18e7e61b3bb6447dcf (patch) | |
tree | aa24722dd6f3395a1160e91b4abc74a593087367 /source4/lib | |
parent | de8a339cdf95f6737a8b1d34aa2aa9287bae0e46 (diff) | |
download | samba-21c215512661907832570d18e7e61b3bb6447dcf.tar.gz samba-21c215512661907832570d18e7e61b3bb6447dcf.tar.bz2 samba-21c215512661907832570d18e7e61b3bb6447dcf.zip |
s4:lib/registry/ldb.c - free some "msg" objects earlier through explicit "talloc_free"s
No other functional change
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/registry/ldb.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c index 122f565813..c14ee70ace 100644 --- a/source4/lib/registry/ldb.c +++ b/source4/lib/registry/ldb.c @@ -417,8 +417,10 @@ static WERROR ldb_get_default_value(TALLOC_CTX *mem_ctx, return WERR_FOOBAR; } - if (res->count == 0 || res->msgs[0]->num_elements == 0) + if (res->count == 0 || res->msgs[0]->num_elements == 0) { + talloc_free(res); return WERR_BADFILE; + } if ((data_type != NULL) && (data != NULL)) { reg_ldb_unpack_value(mem_ctx, res->msgs[0], name, data_type, @@ -647,6 +649,9 @@ static WERROR ldb_del_value(TALLOC_CTX *mem_ctx, struct hive_key *key, ldb_msg_add_empty(msg, "type", LDB_FLAG_MOD_DELETE, NULL); ret = ldb_modify(kd->ldb, msg); + + talloc_free(msg); + if (ret != LDB_SUCCESS) { DEBUG(1, ("ldb_del_value: %s\n", ldb_errstring(kd->ldb))); return WERR_FOOBAR; @@ -758,6 +763,8 @@ static WERROR ldb_del_key(TALLOC_CTX *mem_ctx, const struct hive_key *key, } } } + talloc_free(res_keys); + talloc_free(res_vals); /* Delete the key itself */ ret = ldb_delete(c, ldb_path); @@ -836,6 +843,8 @@ static WERROR ldb_set_value(struct hive_key *parent, ret = LDB_SUCCESS; } + talloc_free(msg); + if (ret != LDB_SUCCESS) { DEBUG(1, ("ldb_set_value: %s\n", ldb_errstring(kd->ldb))); talloc_free(mem_ctx); |