summaryrefslogtreecommitdiff
path: root/source4/nbt_server/wins
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/nbt_server/wins
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/nbt_server/wins')
-rw-r--r--source4/nbt_server/wins/winsdb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/nbt_server/wins/winsdb.c b/source4/nbt_server/wins/winsdb.c
index f423458073..0ac7a4bb7f 100644
--- a/source4/nbt_server/wins/winsdb.c
+++ b/source4/nbt_server/wins/winsdb.c
@@ -85,6 +85,7 @@ uint64_t winsdb_set_maxVersion(struct winsdb_handle *h, uint64_t newMaxVersion)
ret = ldb_search(wins_db, dn, LDB_SCOPE_BASE, NULL, NULL, &res);
if (ret != LDB_SUCCESS) goto failed;
+ talloc_steal(tmp_ctx, res);
if (res->count > 1) goto failed;
talloc_steal(tmp_ctx, res);
@@ -588,6 +589,7 @@ NTSTATUS winsdb_lookup(struct winsdb_handle *h,
ret = ldb_search(wins_db, winsdb_dn(tmp_ctx, name), LDB_SCOPE_BASE,
NULL, NULL, &res);
+ talloc_steal(tmp_ctx, res);
if (ret != LDB_SUCCESS || res->count > 1) {
status = NT_STATUS_INTERNAL_DB_CORRUPTION;
goto failed;
@@ -596,8 +598,6 @@ NTSTATUS winsdb_lookup(struct winsdb_handle *h,
goto failed;
}
- talloc_steal(tmp_ctx, res);
-
status = winsdb_record(h, res->msgs[0], tmp_ctx, now, &rec);
if (!NT_STATUS_IS_OK(status)) goto failed;