mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
conversions: fix memory leak from excess gMTdata initialization (#1787)
`gMTdata` was initialized twice, but freed only once. Drop the first initialization with a local seed, and initialize with `gRandomSeed` instead. Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
committed by
GitHub
parent
a01349c44e
commit
e29d0fd3a1
@@ -118,7 +118,6 @@ const int test_num = ARRAY_SIZE(test_list);
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
int error;
|
||||
cl_uint seed = (cl_uint)time(NULL);
|
||||
|
||||
argc = parseCustomParam(argc, argv);
|
||||
if (argc == -1)
|
||||
@@ -145,8 +144,8 @@ int main(int argc, const char **argv)
|
||||
#endif
|
||||
|
||||
vlog("===========================================================\n");
|
||||
vlog("Random seed: %u\n", seed);
|
||||
gMTdata = init_genrand(seed);
|
||||
vlog("Random seed: %u\n", gRandomSeed);
|
||||
gMTdata = init_genrand(gRandomSeed);
|
||||
|
||||
const char *arg[] = { argv[0] };
|
||||
int ret =
|
||||
@@ -475,8 +474,6 @@ test_status InitCL(cl_device_id device)
|
||||
}
|
||||
}
|
||||
|
||||
gMTdata = init_genrand(gRandomSeed);
|
||||
|
||||
char c[1024];
|
||||
static const char *no_yes[] = { "NO", "YES" };
|
||||
vlog("\nCompute Device info:\n");
|
||||
|
||||
Reference in New Issue
Block a user