From 59b66744f7318d8197f0d2029bf3b641dafa327e Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 15 Oct 2006 23:14:19 +0000 Subject: r19299: Fix possible memleaks (This used to be commit 6fad80bb09113a60689061a2de67711c9924708b) --- source4/nbt_server/wins/winsdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/nbt_server') 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; -- cgit