Skip to content

Feature request: no_sanitize_leak attribute #1700

Open
@djmdjm

Description

@djmdjm

This is a request for an __attribute__((no_sanitize_leak) feature that allow annotating specific assignments or variables for exclusion by the AddressSanitizer memory leak checker.

Ideally, it could be used to suppress a specific allocation:

char *foo;

/* Ignore this specific allocation */
foo = strdup("foo") __attribute__((no_sanitize_leak);

or any allocation to a specific variable:

/* Ignore any allocation in `foo` */
char *foo __attribute__((no_sanitize_leak);

foo = strdup("foo");

The advantage of an attribute over a suppression file is that it lives in the code that it relates to, and therefore is easier to keep up to date.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions