Skip to content

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

Merged
bettio merged 1 commit intoatomvm:mainfrom
pguyot:w07/add-codeql-allocation-without-ensure-free
Mar 11, 2026
Merged

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

Conversation

@pguyot
Copy link
Copy Markdown
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
@pguyot pguyot marked this pull request as ready for review March 11, 2026 06:21
@bettio bettio merged commit e9cb79c into atomvm:main Mar 11, 2026
166 checks passed
@pguyot pguyot deleted the w07/add-codeql-allocation-without-ensure-free branch March 11, 2026 18:10
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.

2 participants