Free task list before exiting.

This allows us to get a clean valgrind pass.

    valgrind -s --soname-synonyms=somalloc=NONE --leak-check=full erm -r u-boot-2021.10/

      ==24385== Memcheck, a memory error detector
      ==24385== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
      ==24385== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
      ==24385== Command: erm -r u-boot-2021.10/
      ==24385==
      ==24385==
      ==24385== HEAP SUMMARY:
      ==24385==     in use at exit: 0 bytes in 0 blocks
      ==24385==   total heap usage: 4,047 allocs, 4,047 frees, 3,850,073 bytes allocated
      ==24385==
      ==24385== All heap blocks were freed -- no leaks are possible
      ==24385==
      ==24385== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
This commit is contained in:
Érico Nogueira 2022-01-21 16:05:56 -03:00
parent 9a1eecd457
commit 657fd48d42
1 changed files with 1 additions and 0 deletions

View File

@ -79,6 +79,7 @@ static inline void queue_remove(struct queue *q, struct task *t)
while (q->len == 0) {
if (q->free == nproc - 1) {
/* we are done removing things */
free(q->tasks);
exit(0);
}
q->free++;