vlib: use malloc_noscan() where possible (#10465)

This commit is contained in:
Uwe Krüger 2021-06-15 13:47:11 +02:00 committed by GitHub
parent af60eba5e6
commit 60c880a0cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 56 additions and 83 deletions

View file

@ -35,7 +35,7 @@ pub fn decode_str(data string) string {
return ''
}
unsafe {
buffer := malloc(size + 1)
buffer := malloc_noscan(size + 1)
buffer[size] = 0
return tos(buffer, decode_in_buffer(data, buffer))
}
@ -62,7 +62,7 @@ fn alloc_and_encode(src &byte, len int) string {
return ''
}
unsafe {
buffer := malloc(size + 1)
buffer := malloc_noscan(size + 1)
buffer[size] = 0
return tos(buffer, encode_from_buffer(buffer, src, len))
}