Use jv_mem_alloc to allocate dtoa_context in tsd_dtoa_context_get (#3356)

This commit is contained in:
엄태용 authored and GitHub committed 2025-06-30 07:27:24 +09:00
1 parent 0b1ef46973
commit 2e6987967e
1 file changed
+2 -1
+2 -1
View File
@@ -40,9 +40,10 @@ inline struct dtoa_context *tsd_dtoa_context_get(void) {
pthread_once(&dtoa_ctx_once, jv_tsd_dtoa_ctx_init); // cannot fail
struct dtoa_context *ctx = (struct dtoa_context*)pthread_getspecific(dtoa_ctx_key);
if (!ctx) {
ctx = malloc(sizeof(struct dtoa_context));
ctx = jv_mem_alloc(sizeof(struct dtoa_context));
jvp_dtoa_context_init(ctx);
if (pthread_setspecific(dtoa_ctx_key, ctx) != 0) {
jv_mem_free(ctx);
fprintf(stderr, "error: cannot set thread specific data");
abort();
}