projects
/
ccan
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4e94428
)
failtest: Remove memory leak
author
David Gibson
<david@gibson.dropbear.id.au>
Sun, 2 Apr 2017 09:06:06 +0000
(19:06 +1000)
committer
David Gibson
<david@gibson.dropbear.id.au>
Wed, 5 Apr 2017 05:56:33 +0000
(15:56 +1000)
Somewhat ironically, a path in failtest related to detecting leaks in the
tested program itself leaks memory. This corrects it.
Detected by Coverity.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
ccan/failtest/failtest.c
patch
|
blob
|
history
diff --git
a/ccan/failtest/failtest.c
b/ccan/failtest/failtest.c
index aab28dd43472449493297d223afafa21d4e667c2..c61ce442a5d03b39444a87a468514f23c6f3c962 100644
(file)
--- a/
ccan/failtest/failtest.c
+++ b/
ccan/failtest/failtest.c
@@
-613,8
+613,10
@@
static NORETURN void failtest_cleanup(bool forced_cleanup, int status)
/* But their program shouldn't leak, even on failure. */
if (!forced_cleanup && i->can_leak) {
+ char *p = failpath_string();
printf("Leak at %s:%u: --failpath=%s\n",
- i->file, i->line, failpath_string());
+ i->file, i->line, p);
+ free(p);
status = 1;
}
}