Skip to content

Commit

Permalink
Merge pull request #104 from pks-t/pks-leaks
Browse files Browse the repository at this point in the history
Memory leak fixes
  • Loading branch information
ethomson authored Jan 16, 2025
2 parents 15580f9 + 2ff1c51 commit 5d8e629
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ jobs:
platform:
- os: ubuntu-latest
generator: Unix Makefiles
- os: ubuntu-latest
generator: Unix Makefiles
env:
CC: "clang"
CFLAGS: "-fsanitize=leak"
- os: macos-latest
generator: Unix Makefiles
- os: windows-latest
Expand All @@ -24,6 +29,10 @@ jobs:

runs-on: ${{ matrix.platform.os }}

env:
CC: ${{matrix.platform.env.CC}}
CFLAGS: ${{matrix.platform.env.CFLAGS}}

steps:
- name: Check out
uses: actions/checkout@v2
Expand Down
8 changes: 8 additions & 0 deletions clar.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,14 @@ clar_test_shutdown(void)
}

for (report = _clar.reports; report; report = report_next) {
struct clar_error *error, *error_next;

for (error = report->errors; error; error = error_next) {
free(error->description);
error_next = error->next;
free(error);
}

report_next = report->next;
free(report);
}
Expand Down

0 comments on commit 5d8e629

Please sign in to comment.