summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorFilipe Brandenburger <filbranden@google.com>2018-06-07 23:37:30 +0200
committerLennart Poettering <lennart@poettering.net>2018-06-08 00:48:41 +0200
commit15b8332e7cc09b1ae2ef71265cd63bfbc8075eec (patch)
tree1916371b8b025048a3acc5d2be459430a10f936f /src/network
parentudev-builtin-usb_id: Check full range of size returned by read() (diff)
downloadsystemd-15b8332e7cc09b1ae2ef71265cd63bfbc8075eec.tar.xz
systemd-15b8332e7cc09b1ae2ef71265cd63bfbc8075eec.zip
networkd: add missing _cleanup_ in prefix_new
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.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-radv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/networkd-radv.c b/src/network/networkd-radv.c
index 464e636876..14927b0439 100644
--- 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)