chdir_notify_register() allows registering functions to notify when chdir() is called. There is no way to unsubscribe or shut this mechanism down, so these entries are present until the program ends. Valgrind reports allocations for these registrations as "possibly lost", probably because it doesn't see through list.h's offsetof tricks. Annotate them using UNLEAK, which causes Valgrind to report them as "still reachable" instead. Signed-off-by: René Scharfe <l.s.r@xxxxxx> --- chdir-notify.c | 1 + 1 file changed, 1 insertion(+) diff --git a/chdir-notify.c b/chdir-notify.c index 5f7f2c2ac2..b236288416 100644 --- a/chdir-notify.c +++ b/chdir-notify.c @@ -16,6 +16,7 @@ void chdir_notify_register(const char *name, void *data) { struct chdir_notify_entry *e = xmalloc(sizeof(*e)); + UNLEAK(e); e->name = name; e->cb = cb; e->data = data; -- 2.29.2