From: Zbigniew Jędrzejewski-Szmek Date: Thu, 24 Oct 2019 10:00:07 +0000 (+0200) Subject: sd-dhcp-client: remove unnecessary cleanup function X-Git-Tag: v244-rc1~160^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9b08c804ef5197ab29f0ef1d96e589ed9c018019;p=thirdparty%2Fsystemd.git sd-dhcp-client: remove unnecessary cleanup function https://github.com/systemd/systemd/pull/13663#discussion_r335327099 --- diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c index 550f614d0c7..9652f70cc00 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;