summaryrefslogtreecommitdiff
path: root/AuDispose.c
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@stoeckmann.org>2022-07-03 11:52:44 +0200
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-07-09 17:34:31 +0000
commit8928883477ff32cbbb97ee0e871324812e3b5c96 (patch)
tree1ac12eefbeb297b9b17465dc23e5fab54ff3eac8 /AuDispose.c
parent19b13bf20de5b15ab87fb4019ec910ef3216129f (diff)
Use explicit_bzero if available
Optimizing compilers may remove the bzero call because it is followed by free. The function explicit_bzero avoids this optimization. Use it if it is available. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Diffstat (limited to 'AuDispose.c')
-rw-r--r--AuDispose.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/AuDispose.c b/AuDispose.c
index 355224d..b24d21c 100644
--- a/AuDispose.c
+++ b/AuDispose.c
@@ -38,7 +38,11 @@ XauDisposeAuth (Xauth *auth)
free (auth->number);
free (auth->name);
if (auth->data) {
+#ifdef HAVE_EXPLICIT_BZERO
+ (void) explicit_bzero (auth->data, auth->data_length);
+#else
(void) bzero (auth->data, auth->data_length);
+#endif
(void) free (auth->data);
}
free ((char *) auth);