From 9b08c804ef5197ab29f0ef1d96e589ed9c018019 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 24 Oct 2019 12:00:07 +0200 Subject: [PATCH] sd-dhcp-client: remove unnecessary cleanup function https://github.com/systemd/systemd/pull/13663#discussion_r335327099 --- src/libsystemd-network/sd-dhcp-client.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c index 550f614..9652f70 100644 --- a/src/libsystemd-network/sd-dhcp-client.c +++ b/src/libsystemd-network/sd-dhcp-client.c @@ -548,16 +548,13 @@ static sd_dhcp_option* dhcp_option_free(sd_dhcp_option *i) { } int sd_dhcp_option_new(uint8_t option, void *data, size_t length, sd_dhcp_option **ret) { - _cleanup_(sd_dhcp_option_unrefp) sd_dhcp_option *p = NULL; - _cleanup_free_ void *q = NULL; - assert(ret); - q = memdup(data, length); + _cleanup_free_ void *q = memdup(data, length); if (!q) return -ENOMEM; - p = new(sd_dhcp_option, 1); + sd_dhcp_option *p = new(sd_dhcp_option, 1); if (!p) return -ENOMEM; -- 2.7.4