Replace OpenSSL malloc hooks with safer retry-capable malloc hooks

This commit is contained in:
obdev
2024-04-16 11:28:05 +00:00
committed by ob-robot
parent 1044aef268
commit 10b859b618

View File

@ -361,7 +361,8 @@ static void* ob_malloc_openssl(size_t nbyte, const char *, int)
attr.ctx_id_ = ObCtxIds::GLIBC;
attr.label_ = ObModIds::OB_BUFFER;
SET_IGNORE_MEM_VERSION(attr);
return ob_malloc(nbyte, attr);
lib::ObMallocHookAttrGuard guard(attr);
return malloc(nbyte);
}
static void* ob_realloc_openssl(void *ptr, size_t nbyte, const char *, int)
@ -370,12 +371,13 @@ static void* ob_realloc_openssl(void *ptr, size_t nbyte, const char *, int)
attr.ctx_id_ = ObCtxIds::GLIBC;
attr.label_ = ObModIds::OB_BUFFER;
SET_IGNORE_MEM_VERSION(attr);
return ob_realloc(ptr, nbyte, attr);
lib::ObMallocHookAttrGuard guard(attr);
return realloc(ptr, nbyte);
}
static void ob_free_openssl(void *ptr, const char *, int)
{
ob_free(ptr);
free(ptr);
}
int ObEncryptionUtil::init_ssl_malloc()