ASAN replaces malloc and free with its own implementation.
Should not run jemalloc with ASAN simultaneously. Change-Id: I2ea3107178c11fe34978bb093737564e1222c0d5 Signed-off-by: niewei <niewei@xiaomi.com> Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/51945 Reviewed-by: Adam Langley <agl@google.com> Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com>
This commit is contained in:
parent
8c8e7a683f
commit
f94a7ce599
@ -180,11 +180,17 @@ void OPENSSL_free(void *orig_ptr) {
|
||||
|
||||
size_t size = *(size_t *)ptr;
|
||||
OPENSSL_cleanse(ptr, size + OPENSSL_MALLOC_PREFIX);
|
||||
|
||||
// ASan knows to intercept malloc and free, but not sdallocx.
|
||||
#if defined(OPENSSL_ASAN)
|
||||
free(ptr);
|
||||
#else
|
||||
if (sdallocx) {
|
||||
sdallocx(ptr, size + OPENSSL_MALLOC_PREFIX, 0 /* flags */);
|
||||
} else {
|
||||
free(ptr);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void *OPENSSL_realloc(void *orig_ptr, size_t new_size) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user