Skip to content

Commit

Permalink
Fix C runtime memory leak (#767)
Browse files Browse the repository at this point in the history
  • Loading branch information
denismerigoux authored Jan 8, 2025
2 parents bce7e94 + e94e4b6 commit 9d8584a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions runtimes/c/runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,12 @@ void* catala_malloc (size_t sz)

void catala_free_all()
{
struct catala_heap * next_ptr;
while (catala_heap.mem != NULL) {
free(catala_heap.mem);
next_ptr = catala_heap.next;
catala_heap = *catala_heap.next;
free(next_ptr);
}
}

Expand Down

0 comments on commit 9d8584a

Please sign in to comment.