summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-09-21 13:38:37 +0900
committerJunio C Hamano <gitster@pobox.com>2017-09-21 13:38:37 +0900
commit59c0ea183ad1c5c2b3790caa5046e4ecfa839247 (patch)
tree242ae5e21d079bd057f935d818117ca17a087790
parent9ddaf86b06a8078420f59aec8cab6daa93cf1a91 (diff)
parent5de3de329ac2fafa4b5762a6d0384312897793e5 (diff)
downloadgit-59c0ea183ad1c5c2b3790caa5046e4ecfa839247.tar.gz
Merge branch 'jk/leak-checkers'
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
-rw-r--r--git-compat-util.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 003e444c46..9bc15b0363 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -1184,9 +1184,9 @@ extern int cmd_main(int, const char **);
*/
#ifdef SUPPRESS_ANNOTATED_LEAKS
extern void unleak_memory(const void *ptr, size_t len);
-#define UNLEAK(var) unleak_memory(&(var), sizeof(var));
+#define UNLEAK(var) unleak_memory(&(var), sizeof(var))
#else
-#define UNLEAK(var)
+#define UNLEAK(var) do {} while (0)
#endif
#endif