projects
/
haproxy-2.5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e0c1d74
)
DEV: coccinelle: Add realloc_leak.cocci
author
Tim Duesterhus
<tim@bastelstu.be>
Sat, 23 Oct 2021 17:53:35 +0000
(19:53 +0200)
committer
Willy Tarreau
<w@1wt.eu>
Thu, 28 Oct 2021 07:45:48 +0000
(09:45 +0200)
This coccinelle patch finds locations where the return value of `realloc()` is
assigned to the pointer passed to `realloc()`. This calls will leak memory if
`realloc()` returns `NULL`.
dev/coccinelle/realloc_leak.cocci
[new file with mode: 0644]
patch
|
blob
diff --git a/dev/coccinelle/realloc_leak.cocci
b/dev/coccinelle/realloc_leak.cocci
new file mode 100644
(file)
index 0000000..
c201b80
--- /dev/null
+++ b/
dev/coccinelle/realloc_leak.cocci
@@ -0,0
+1,6
@@
+@@
+expression E;
+expression F;
+@@
+
+* E = realloc(E, F);