summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorAlice Nyaa <[email protected]>2024-06-22 13:17:31 -0400
committerGitHub <[email protected]>2024-06-22 19:17:31 +0200
commitb0d49579c17e7b2bcebd0afc0b8cdb7314b5f41d (patch)
tree1998ffc9a51acd41c20531af043f66157382f32b /src
parent28f88fd9840057991a1573212a497b0123631fbc (diff)
downloadraylib-b0d49579c17e7b2bcebd0afc0b8cdb7314b5f41d.tar.gz
raylib-b0d49579c17e7b2bcebd0afc0b8cdb7314b5f41d.zip
fixed LoadCodepoints returning a freed ptr when count is 0 (#4089)
Diffstat (limited to 'src')
-rw-r--r--src/rtext.c3
1 files changed, 1 insertions, 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;