Skip to content

Commit b38dad0

Browse files
Merge pull request #40 from drakenclimber/coverity
adaptived: Fix a memory leak reported by Coverity
2 parents cb8f68c + 6b3d134 commit b38dad0

File tree

2 files changed

+7
-27
lines changed

2 files changed

+7
-27
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -142,27 +142,15 @@ jobs:
142142
run: |
143143
cat adaptived/tests/ftests/ftests-wrapper.sh.log
144144
cat adaptived/tests/ftests/ftests-c-wrapper.sh.log
145-
- name: Archive test logs
146-
if: ${{ always() }}
147-
uses: actions/upload-artifact@v4
148-
with:
149-
name: Adaptived functional test logs
150-
path: adaptived/tests/*/*.log
151145
- name: Collate code coverage results
152146
uses: ./.github/actions/code-coverage
153147
- name: Upload code coverage results
154148
uses: coverallsapp/github-action@master
155149
with:
156150
github-token: ${{ secrets.GITHUB_TOKEN }}
157151
path-to-lcov: ./lcov.total
158-
flag-name: "Adaptived Functional Tests"
152+
flag-name: "Adaptived Functional Tests - cgv1"
159153
parallel: True
160-
- name: Archive code coverage results
161-
if: ${{ always() }}
162-
uses: actions/upload-artifact@v4
163-
with:
164-
name: Adaptived Functional Tests Code Coverage
165-
path: lcov.*
166154

167155
functional_tests_cgv2:
168156
name: Adaptived Functional Tests v2
@@ -185,27 +173,15 @@ jobs:
185173
run: |
186174
cat adaptived/tests/ftests/ftests-wrapper.sh.log
187175
cat adaptived/tests/ftests/ftests-c-wrapper.sh.log
188-
- name: Archive test logs
189-
if: ${{ always() }}
190-
uses: actions/upload-artifact@v4
191-
with:
192-
name: Adaptived functional test logs
193-
path: adaptived/tests/*/*.log
194176
- name: Collate code coverage results
195177
uses: ./.github/actions/code-coverage
196178
- name: Upload code coverage results
197179
uses: coverallsapp/github-action@master
198180
with:
199181
github-token: ${{ secrets.GITHUB_TOKEN }}
200182
path-to-lcov: ./lcov.total
201-
flag-name: "Adaptived Functional Tests"
183+
flag-name: "Adaptived Functional Tests - cgv2"
202184
parallel: True
203-
- name: Archive code coverage results
204-
if: ${{ always() }}
205-
uses: actions/upload-artifact@v4
206-
with:
207-
name: Adaptived Functional Tests Code Coverage
208-
path: lcov.*
209185

210186
finalize:
211187
name: Finalize the test run

adaptived/src/effects/cgroup_setting_by_psi.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, Oracle and/or its affiliates.
2+
* Copyright (c) 2024-2025, Oracle and/or its affiliates.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -205,6 +205,8 @@ int cgroup_setting_psi_init(struct adaptived_effect * const eff, struct json_obj
205205
if (opts) {
206206
if (opts->cgroup_path)
207207
free(opts->cgroup_path);
208+
if (opts->cgroup_setting)
209+
free(opts->cgroup_setting);
208210
adaptived_free_cgroup_value(&opts->value);
209211
adaptived_free_cgroup_value(&opts->limit);
210212

@@ -461,6 +463,8 @@ void cgroup_setting_psi_exit(struct adaptived_effect * const eff)
461463

462464
if (opts->cgroup_path)
463465
free(opts->cgroup_path);
466+
if (opts->cgroup_setting)
467+
free(opts->cgroup_setting);
464468
adaptived_free_cgroup_value(&opts->value);
465469
adaptived_free_cgroup_value(&opts->limit);
466470
free(opts);

0 commit comments

Comments
 (0)