Skip to content
Snippets Groups Projects
Commit 4e5c0dc6 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel:
Browse files

Use failsafe malloc wrappers.

parent d12a6f9b
No related branches found
No related tags found
2 merge requests!91Add alternative code path for huge buffers.,!89Miscellaneous fixes and CDI-PIO improvements
......@@ -279,7 +279,7 @@ grb_read_next_record(stream_t *streamptr, int recID, int memType, void *data, si
// if this is the first call, init and start worker threads
if (!jobs)
{
jobs = (JobDescriptor *) malloc(workerCount * sizeof(*jobs));
jobs = Malloc((size_t)workerCount * sizeof(*jobs));
streamptr->jobs = jobs;
for (int i = 0; i < workerCount; i++) jobs[i].args.recID = -1;
for (int i = 0; i < workerCount; i++) jobs[i].args.tsID = -1;
......
......@@ -1293,7 +1293,7 @@ streamDestroy(stream_t *streamptr)
mycdiVlistDestroy_(vlistID, true);
}
if (streamptr->jobs) free(streamptr->jobs);
if (streamptr->jobs) Free(streamptr->jobs);
if (streamptr->jobManager) AsyncWorker_finalize((AsyncManager *) streamptr->jobManager);
Free(streamptr);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment