Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
7b89865b
Commit
7b89865b
authored
Jul 29, 2011
by
Markus Kauppila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed potential memory leak from test case loading.
parent
43b873b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
fuzzer.c
test/test-automation/fuzzer/fuzzer.c
+1
-0
runner.c
test/test-automation/runner.c
+16
-0
No files found.
test/test-automation/fuzzer/fuzzer.c
View file @
7b89865b
...
...
@@ -50,6 +50,7 @@ GenerateExecKey(char *runSeed, char *suiteName,
char
*
execKey
=
md5Context
.
digest
;
//! \todo could this be enhanced?
int
key
=
execKey
[
4
]
<<
24
|
execKey
[
9
]
<<
16
|
execKey
[
13
]
<<
8
|
...
...
test/test-automation/runner.c
View file @
7b89865b
...
...
@@ -264,6 +264,7 @@ ScanForTestSuites(char *directoryName, char *extension)
SDL_free
(
reference
);
return
NULL
;
}
SDL_snprintf
(
reference
->
directoryPath
,
dpSize
,
"%s%s.%s"
,
directoryName
,
name
,
ext
);
...
...
@@ -398,16 +399,31 @@ LoadTestCases(TestSuiteReference *suites)
// copy suite name
int
length
=
SDL_strlen
(
suiteReference
->
name
)
+
1
;
item
->
suiteName
=
SDL_malloc
(
length
);
if
(
item
->
suiteName
==
NULL
)
{
SDL_free
(
item
);
return
NULL
;
}
strncpy
(
item
->
suiteName
,
suiteReference
->
name
,
length
);
// copy test name
length
=
SDL_strlen
(
testReference
->
name
)
+
1
;
item
->
testName
=
SDL_malloc
(
length
);
if
(
item
->
testName
==
NULL
)
{
SDL_free
(
item
->
suiteName
);
SDL_free
(
item
);
return
NULL
;
}
strncpy
(
item
->
testName
,
testReference
->
name
,
length
);
// copy test description
length
=
SDL_strlen
(
testReference
->
description
)
+
1
;
item
->
description
=
SDL_malloc
(
length
);
if
(
item
->
description
==
NULL
)
{
SDL_free
(
item
->
description
);
SDL_free
(
item
->
suiteName
);
SDL_free
(
item
);
return
NULL
;
}
strncpy
(
item
->
description
,
testReference
->
description
,
length
);
item
->
requirements
=
testReference
->
requirements
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment