summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Sorce <simo@metason.pico.li.ssimo.org>2009-10-26 15:11:14 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-10-27 13:35:11 -0400
commit10d858c6a0c50be224226daddb60f0d8f8c7978c (patch)
treeb0b8c5c6534c7d7137021795032f468e5ea035aa
parentb303921f249efeaa8c2b699f3877a70a3b5c98de (diff)
downloadsssd-10d858c6a0c50be224226daddb60f0d8f8c7978c.tar.gz
sssd-10d858c6a0c50be224226daddb60f0d8f8c7978c.tar.xz
sssd-10d858c6a0c50be224226daddb60f0d8f8c7978c.zip
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.
-rw-r--r--server/db/sysdb.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/db/sysdb.c b/server/db/sysdb.c
index a0c13385b..5811ddc96 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;