mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-25 16:29:03 +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 main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
cl_uint seed = (cl_uint)time(NULL);
|
|
||||||
|
|
||||||
argc = parseCustomParam(argc, argv);
|
argc = parseCustomParam(argc, argv);
|
||||||
if (argc == -1)
|
if (argc == -1)
|
||||||
@@ -145,8 +144,8 @@ int main(int argc, const char **argv)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
vlog("===========================================================\n");
|
vlog("===========================================================\n");
|
||||||
vlog("Random seed: %u\n", seed);
|
vlog("Random seed: %u\n", gRandomSeed);
|
||||||
gMTdata = init_genrand(seed);
|
gMTdata = init_genrand(gRandomSeed);
|
||||||
|
|
||||||
const char *arg[] = { argv[0] };
|
const char *arg[] = { argv[0] };
|
||||||
int ret =
|
int ret =
|
||||||
@@ -475,8 +474,6 @@ test_status InitCL(cl_device_id device)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gMTdata = init_genrand(gRandomSeed);
|
|
||||||
|
|
||||||
char c[1024];
|
char c[1024];
|
||||||
static const char *no_yes[] = { "NO", "YES" };
|
static const char *no_yes[] = { "NO", "YES" };
|
||||||
vlog("\nCompute Device info:\n");
|
vlog("\nCompute Device info:\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user