From e83a84cdce6f5722c027923f6776ae606c3ca6e9 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 26 Oct 2009 15:11:14 -0400 Subject: Zero pointers on free If the pointer stays around, zero it when it is freed, so we do not risk access to released memory in case of bugs. --- server/db/sysdb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/db/sysdb.c b/server/db/sysdb.c index a0c13385..5811ddc9 100644 --- a/server/db/sysdb.c +++ b/server/db/sysdb.c @@ -471,7 +471,7 @@ int sysdb_transaction_commit_recv(struct tevent_req *req) /* finally free handle * this will also trigger the next transaction in the queue if any */ - talloc_free(state->handle); + talloc_zfree(state->handle); if (tevent_req_is_error(req, &tstate, &err)) { return err; @@ -1227,7 +1227,7 @@ static int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx, ret = EIO; goto done; } - talloc_free(msg); + talloc_zfree(msg); /* == create Users tree == */ @@ -1255,7 +1255,7 @@ static int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx, ret = EIO; goto done; } - talloc_free(msg); + talloc_zfree(msg); /* == create Groups tree == */ @@ -1283,7 +1283,7 @@ static int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx, ret = EIO; goto done; } - talloc_free(msg); + talloc_zfree(msg); ret = EOK; -- cgit