Skip to content

Add CodeQL query to check for allocations not preceeded by ensure_free#2104

Draft
pguyot wants to merge 1 commit intoatomvm:mainfrom
pguyot:w07/add-codeql-allocation-without-ensure-free
Draft

Add CodeQL query to check for allocations not preceeded by ensure_free#2104
pguyot wants to merge 1 commit intoatomvm:mainfrom
pguyot:w07/add-codeql-allocation-without-ensure-free

Conversation

@pguyot
Copy link
Collaborator

@pguyot pguyot commented Feb 15, 2026

Continuation of

Fix several cases where this happened in nifs. Also add a NOLINT comment
for cases where the query is not smart enough to remove the couple of
false positives.

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

@pguyot pguyot force-pushed the w07/add-codeql-allocation-without-ensure-free branch from f2e7ae2 to f5352be Compare February 22, 2026 20:04
@pguyot pguyot force-pushed the w07/add-codeql-allocation-without-ensure-free branch from f5352be to 2f620f0 Compare March 10, 2026 20:58
Fix several cases where this happened in nifs. Also add a NOLINT comment
for cases where the query is not smart enough to remove the couple of
false positives.

Also clean up some CodeQL logic and fixed a cleanup in dac_driver.c if
allocation failed

Signed-off-by: Paul Guyot <pguyot@kallisys.net>
@pguyot pguyot force-pushed the w07/add-codeql-allocation-without-ensure-free branch from 2f620f0 to 91e96d9 Compare March 10, 2026 21:08
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.

1 participant