Open
Description
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.