projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9d635f5
)
networkd: add missing _cleanup_ in prefix_new
author
Filipe Brandenburger
<filbranden@google.com>
Thu, 7 Jun 2018 21:37:30 +0000
(14:37 -0700)
committer
Lennart Poettering
<lennart@poettering.net>
Thu, 7 Jun 2018 22:48:41 +0000
(
00:48
+0200)
This should fix a leak of the allocated Prefix if sd_radv_prefix_new
fails for some reason.
The code was already initializing prefix to NULL and using TAKE_PTR to
return it, so only the _cleanup_ was missing.
Fixes Coverity finding CID 1382976.
src/network/networkd-radv.c
patch
|
blob
|
history
diff --git
a/src/network/networkd-radv.c
b/src/network/networkd-radv.c
index
464e636
..
14927b0
100644
(file)
--- a/
src/network/networkd-radv.c
+++ b/
src/network/networkd-radv.c
@@
-104,7
+104,7
@@
void prefix_free(Prefix *prefix) {
}
int prefix_new(Prefix **ret) {
- Prefix *prefix = NULL;
+
_cleanup_(prefix_freep)
Prefix *prefix = NULL;
prefix = new0(Prefix, 1);
if (!prefix)