diff options
author | Patrik Flykt <patrik.flykt@linux.intel.com> | 2017-11-27 14:07:22 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-11-27 13:07:22 +0100 |
commit | a86d329f225cbe093eefe1de37ac5cf2b53b8872 (patch) | |
tree | 8579b86f754584c2f7b820980336375474dad1fe /src/network/networkd-address.c | |
parent | 401e33ed56f3cd3736bbab02ca6eb31aa592cf53 (diff) | |
download | systemd-a86d329f225cbe093eefe1de37ac5cf2b53b8872.tar.gz |
networkd: Free Prefix in case allocation fails (#7480)
Set the code to call _cleanup_prefix_free_ in case the next allocation
fails so that Prefix does not leak memory.
Reported by evverx.
Diffstat (limited to 'src/network/networkd-address.c')
-rw-r--r-- | src/network/networkd-address.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index 976be17c0e..ff125e35de 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -1035,7 +1035,7 @@ void prefix_free(Prefix *prefix) { } int prefix_new(Prefix **ret) { - Prefix *prefix = NULL; + _cleanup_prefix_free_ Prefix *prefix = NULL; prefix = new0(Prefix, 1); if (!prefix) |