mirror of
https://github.com/rwinkhart/cmutton.git
synced 2026-09-05 16:47:28 -04:00
Use platform-specific implementations of securePtrOverwriteAndFree
This commit is contained in:
@@ -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.memset_s(input, length, 0, length)
|
||||
C.free(input)
|
||||
}
|
||||
Reference in New Issue
Block a user