aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mds-clipboard.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mds-clipboard.c b/src/mds-clipboard.c
index 52f40f0..02918ae 100644
--- a/src/mds-clipboard.c
+++ b/src/mds-clipboard.c
@@ -204,15 +204,21 @@ size_t marshal_server_size(void)
/**
+ * `memset`, but the compiler does not know that
+ */
+void* (* volatile mds_clipboard_my_explicit_memset)(void* s, int c, size_t n) = memset;
+
+
+/**
* Wipe a memory area and free it
*
* @param s The memory area
* @param n The number of bytes to write
*/
-static inline __attribute__((optimize("-O0"))) void wipe_and_free(void* s, size_t n)
+static inline void wipe_and_free(void* s, size_t n)
{
if (s != NULL)
- free(memset(s, 0, n)); /* TODO use explicit_bzero-like wipe */
+ free(mds_clipboard_my_explicit_memset(s, 0, n));
}