mirror of
https://github.com/rwinkhart/cmutton.git
synced 2026-08-27 20:36:31 -04:00
15 lines
331 B
Go
15 lines
331 B
Go
//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)
|
|
}
|