From b0d49579c17e7b2bcebd0afc0b8cdb7314b5f41d Mon Sep 17 00:00:00 2001 From: Alice Nyaa <62451415+Minnowo@users.noreply.github.com> Date: Sat, 22 Jun 2024 13:17:31 -0400 Subject: [PATCH] fixed LoadCodepoints returning a freed ptr when count is 0 (#4089) --- src/rtext.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/rtext.c b/src/rtext.c index 6ad0f90a..62d786ea 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1892,8 +1892,7 @@ int *LoadCodepoints(const char *text, int *count) } // Re-allocate buffer to the actual number of codepoints loaded - int *temp = (int *)RL_REALLOC(codepoints, codepointCount*sizeof(int)); - if (temp != NULL) codepoints = temp; + codepoints = (int *)RL_REALLOC(codepoints, codepointCount*sizeof(int)); *count = codepointCount;