Use platform-specific implementations of securePtrOverwriteAndFree

This commit is contained in:
2026-02-07 23:29:11 -05:00
parent bfc6d97773
commit 904c084711
4 changed files with 30 additions and 8 deletions
+14
View File
@@ -0,0 +1,14 @@
//go:build !ios
package main
// #include <string.h>
// #include <stdlib.h>
import "C"
import "unsafe"
// securePtrOverwriteAndFree securely overwrites the memory at the input pointer and then frees it.
func securePtrOverwriteAndFree(input unsafe.Pointer, length C.size_t) {
C.explicit_bzero(input, C.size_t(length))
C.free(input)
}