diff options
author | Filipe Brandenburger <filbranden@google.com> | 2018-06-07 23:37:30 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-06-08 00:48:41 +0200 |
commit | 15b8332e7cc09b1ae2ef71265cd63bfbc8075eec (patch) | |
tree | 1916371b8b025048a3acc5d2be459430a10f936f /src/network | |
parent | udev-builtin-usb_id: Check full range of size returned by read() (diff) | |
download | systemd-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.c | 2 |
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) |