Skip to content

Commit 5e9ba01

Browse files
committed
Merge branch 'jk/leak-checkers' into next
Many of our programs consider that it is OK to release dynamic storage that is used throughout the life of the program by simply exiting, but this makes it harder to leak detection tools to avoid reporting false positives. Plug many existing leaks and introduce a mechanism for developers to mark that the region of memory pointed by a pointer is not lost/leaking to help these tools. * jk/leak-checkers: git-compat-util: make UNLEAK less error-prone
2 parents 90011f5 + 5de3de3 commit 5e9ba01

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

git-compat-util.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,9 +1184,9 @@ extern int cmd_main(int, const char **);
11841184
*/
11851185
#ifdef SUPPRESS_ANNOTATED_LEAKS
11861186
extern void unleak_memory(const void *ptr, size_t len);
1187-
#define UNLEAK(var) unleak_memory(&(var), sizeof(var));
1187+
#define UNLEAK(var) unleak_memory(&(var), sizeof(var))
11881188
#else
1189-
#define UNLEAK(var)
1189+
#define UNLEAK(var) do {} while (0)
11901190
#endif
11911191

11921192
#endif

0 commit comments

Comments
 (0)