From f13e48e2ee205036983fb5c2abe28b4bfaa31856 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 1 Jul 2003 13:04:50 +0000 Subject: Different fix for memleak just committed. This belongs into tdb_search_list_free. Volker (This used to be commit 0f3822c8e71426983b960ad49511efa8707159f9) --- source3/lib/gencache.c | 2 -- source3/passdb/secrets.c | 2 -- source3/tdb/tdbutil.c | 1 + 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c index b94e35eff4..f3740e3e12 100644 --- a/source3/lib/gencache.c +++ b/source3/lib/gencache.c @@ -329,7 +329,6 @@ void gencache_iterate(void (*fn)(const char* key, const char *value, time_t time if (!databuf.dptr || databuf.dsize <= TIMEOUT_LEN) { SAFE_FREE(databuf.dptr); SAFE_FREE(keystr); - SAFE_FREE(node->node_key.dptr); node = node->next; continue; } @@ -345,7 +344,6 @@ void gencache_iterate(void (*fn)(const char* key, const char *value, time_t time SAFE_FREE(valstr); SAFE_FREE(entry); SAFE_FREE(keystr); - SAFE_FREE(node->node_key.dptr); node = node->next; } diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c index 57a539b092..c039fe53b4 100644 --- a/source3/passdb/secrets.c +++ b/source3/passdb/secrets.c @@ -616,8 +616,6 @@ NTSTATUS secrets_get_trusted_domains(TALLOC_CTX* ctx, int* enum_ctx, unsigned in return NT_STATUS_NO_MEMORY; } - SAFE_FREE(k->node_key.dptr); - packed_pass = secrets_fetch(secrets_key, &size); packed_size = tdb_trusted_dom_pass_unpack(packed_pass, size, pass); /* packed representation isn't needed anymore */ diff --git a/source3/tdb/tdbutil.c b/source3/tdb/tdbutil.c index 19dfe642df..595062dc87 100644 --- a/source3/tdb/tdbutil.c +++ b/source3/tdb/tdbutil.c @@ -821,6 +821,7 @@ void tdb_search_list_free(TDB_LIST_NODE* node) while (node) { next_node = node->next; + SAFE_FREE(node->node_key.dptr); SAFE_FREE(node); node = next_node; }; -- cgit