Skip to content
Snippets Groups Projects
Commit 2cba5fc6 authored by Jan Včelák's avatar Jan Včelák :rocket:
Browse files

scan-build: fix garbage processing if threads fail to create

parent 083e63a7
No related branches found
No related tags found
No related merge requests found
......@@ -336,7 +336,7 @@ dt_unit_t *dt_create(int count)
unit->size = count;
// Alloc threads
unit->threads = malloc(count * sizeof(dthread_t *));
unit->threads = calloc(count, sizeof(dthread_t *));
if (unit->threads == 0) {
pthread_cond_destroy(&unit->_notify);
pthread_cond_destroy(&unit->_report);
......
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