Преглед на файлове

fixed LoadCodepoints returning a freed ptr when count is 0 (#4089)

Alice Nyaa преди 1 година
родител
ревизия
b0d49579c1
променени са 1 файла, в които са добавени 1 реда и са изтрити 2 реда
  1. 1 2
      src/rtext.c

+ 1 - 2
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;