Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leak in C API test #5303

Merged
merged 1 commit into from
Feb 2, 2024
Merged

Conversation

szkarpinski
Copy link
Collaborator

Category:

Bug fix (non-breaking change which fixes an issue)

Description:

Checkpoint was not freed in C API test, resulting in a memory leak.

Additional information:

Affected modules and functionalities:

C API tests

Key points relevant for the review:

Tests:

  • Existing tests apply
  • New tests added
    • Python tests
    • GTests
    • Benchmark
    • Other
  • N/A

Checklist

Documentation

  • Existing documentation applies
  • Documentation updated
    • Docstring
    • Doxygen
    • RST
    • Jupyter
    • Other
  • N/A

DALI team only

Requirements

  • Implements new requirements
  • Affects existing requirements
  • N/A

REQ IDs: N/A

JIRA TASK: N/A

Signed-off-by: Szymon Karpiński <skarpinski@nvidia.com>
@@ -1119,6 +1119,7 @@ TEST(CApiTest, CheckpointingTest) {
auto handle2 = CreateCheckpointingTestPipe();
daliExternalContextCheckpoint restored_external_context{};
daliRestoreFromSerializedCheckpoint(&handle2, cpt, n, &restored_external_context);
free(cpt);
Copy link
Contributor

@mzient mzient Feb 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's more of a remark about the C API than this PR. It's generally not a good C API design when a function returns memory that is freed elsewhere, with generic C library calls. We should probably have a daliFree function.

@mzient mzient self-assigned this Feb 2, 2024
@klecki klecki self-assigned this Feb 2, 2024
@szkarpinski
Copy link
Collaborator Author

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [12538840]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [12538840]: BUILD PASSED

@szkarpinski szkarpinski merged commit 5f57f0b into NVIDIA:main Feb 2, 2024
7 checks passed
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants