summaryrefslogtreecommitdiff
path: root/usage.c
diff options
context:
space:
mode:
Diffstat (limited to 'usage.c')
-rw-r--r--usage.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/usage.c b/usage.c
index 1ea7df9a20..cdd534c9df 100644
--- a/usage.c
+++ b/usage.c
@@ -241,3 +241,18 @@ NORETURN void BUG(const char *fmt, ...)
va_end(ap);
}
#endif
+
+#ifdef SUPPRESS_ANNOTATED_LEAKS
+void unleak_memory(const void *ptr, size_t len)
+{
+ static struct suppressed_leak_root {
+ struct suppressed_leak_root *next;
+ char data[FLEX_ARRAY];
+ } *suppressed_leaks;
+ struct suppressed_leak_root *root;
+
+ FLEX_ALLOC_MEM(root, data, ptr, len);
+ root->next = suppressed_leaks;
+ suppressed_leaks = root;
+}
+#endif