summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-10-15 23:14:19 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:21:04 -0500
commit59b66744f7318d8197f0d2029bf3b641dafa327e (patch)
tree03d44cfb4bc655088a411552743531246e06974b /source4/lib
parenta719444f68c7448f53ce61dc9f02e552a98fedcf (diff)
downloadsamba-59b66744f7318d8197f0d2029bf3b641dafa327e.tar.gz
samba-59b66744f7318d8197f0d2029bf3b641dafa327e.tar.bz2
samba-59b66744f7318d8197f0d2029bf3b641dafa327e.zip
r19299: Fix possible memleaks
(This used to be commit 6fad80bb09113a60689061a2de67711c9924708b)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/ldb/modules/ldb_map.c2
-rw-r--r--source4/lib/registry/reg_backend_ldb.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/source4/lib/ldb/modules/ldb_map.c b/source4/lib/ldb/modules/ldb_map.c
index 0c58687ddb..f9ae66a2aa 100644
--- a/source4/lib/ldb/modules/ldb_map.c
+++ b/source4/lib/ldb/modules/ldb_map.c
@@ -1233,11 +1233,13 @@ static int map_init_dns(struct ldb_module *module, struct ldb_map_context *data,
if (res->count == 0) {
ldb_debug(module->ldb, LDB_DEBUG_ERROR, "ldb_map: "
"No results for '%s=%s'!\n", MAP_DN_NAME, name);
+ talloc_free(res);
return LDB_ERR_CONSTRAINT_VIOLATION;
}
if (res->count > 1) {
ldb_debug(module->ldb, LDB_DEBUG_ERROR, "ldb_map: "
"Too many results for '%s=%s'!\n", MAP_DN_NAME, name);
+ talloc_free(res);
return LDB_ERR_CONSTRAINT_VIOLATION;
}
diff --git a/source4/lib/registry/reg_backend_ldb.c b/source4/lib/registry/reg_backend_ldb.c
index d723b1dbe4..8edbc5a085 100644
--- a/source4/lib/registry/reg_backend_ldb.c
+++ b/source4/lib/registry/reg_backend_ldb.c
@@ -240,6 +240,7 @@ static WERROR ldb_open_key(TALLOC_CTX *mem_ctx, const struct registry_key *h, co
DEBUG(0, ("Error opening key '%s': %s\n", ldb_dn_linearize(ldap_path, ldap_path), ldb_errstring(c)));
return WERR_FOOBAR;
} else if (res->count == 0) {
+ talloc_free(res);
return WERR_BADFILE;
}