mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-06 11:28:15 +00:00
src/test/SDL_test_harness.c: Free variables before returning
This commit is contained in:

committed by
Sam Lantinga

parent
84a236c92e
commit
c6a3b5b6ef
@@ -515,6 +515,7 @@ int SDLTest_ExecuteTestSuiteRunner(SDLTest_TestSuiteRunner *runner)
|
|||||||
|
|
||||||
arraySuites = SDL_malloc(nbSuites * sizeof(int));
|
arraySuites = SDL_malloc(nbSuites * sizeof(int));
|
||||||
if (!arraySuites) {
|
if (!arraySuites) {
|
||||||
|
SDL_free(failedTests);
|
||||||
return SDL_OutOfMemory();
|
return SDL_OutOfMemory();
|
||||||
}
|
}
|
||||||
for (i = 0; i < nbSuites; i++) {
|
for (i = 0; i < nbSuites; i++) {
|
||||||
@@ -586,6 +587,8 @@ int SDLTest_ExecuteTestSuiteRunner(SDLTest_TestSuiteRunner *runner)
|
|||||||
|
|
||||||
arrayTestCases = SDL_malloc(nbTestCases * sizeof(int));
|
arrayTestCases = SDL_malloc(nbTestCases * sizeof(int));
|
||||||
if (!arrayTestCases) {
|
if (!arrayTestCases) {
|
||||||
|
SDL_free(arraySuites);
|
||||||
|
SDL_free(failedTests);
|
||||||
return SDL_OutOfMemory();
|
return SDL_OutOfMemory();
|
||||||
}
|
}
|
||||||
for (j = 0; j < nbTestCases; j++) {
|
for (j = 0; j < nbTestCases; j++) {
|
||||||
|
Reference in New Issue
Block a user