diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-11-17 00:16:21 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-11-17 00:52:10 +0100 |
commit | 0c28d28834f71e74d5a2d8bcfb19938a34396036 (patch) | |
tree | 77f84095bf0dc28e3f361c00c6722096b6046f5d | |
parent | 65c1d46b0923771955519329160a1e4c7cd027b0 (diff) |
sd-ipv4ll: fix error path if sd-ipv4acd allocation fails
Let's make sure the destructor cannot hit the n_ref == 0 case.
-rw-r--r-- | src/libsystemd-network/sd-ipv4ll.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsystemd-network/sd-ipv4ll.c b/src/libsystemd-network/sd-ipv4ll.c index 006db6feee..30a7ef5785 100644 --- a/src/libsystemd-network/sd-ipv4ll.c +++ b/src/libsystemd-network/sd-ipv4ll.c @@ -101,6 +101,8 @@ int sd_ipv4ll_new(sd_ipv4ll **ret) { if (!ll) return -ENOMEM; + ll->n_ref = 1; + r = sd_ipv4acd_new(&ll->acd); if (r < 0) return r; @@ -109,8 +111,6 @@ int sd_ipv4ll_new(sd_ipv4ll **ret) { if (r < 0) return r; - ll->n_ref = 1; - *ret = ll; ll = NULL; |