mirror of
https://github.com/rwinkhart/cmutton.git
synced 2026-09-05 08:37:33 -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.explicit_bzero(input, C.size_t(length))
|
||||
C.free(input)
|
||||
}
|
||||
Reference in New Issue
Block a user