]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-dhcp-client: remove unnecessary cleanup function
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 24 Oct 2019 10:00:07 +0000 (12:00 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 24 Oct 2019 10:00:07 +0000 (12:00 +0200)
https://github.com/systemd/systemd/pull/13663#discussion_r335327099

src/libsystemd-network/sd-dhcp-client.c

index 550f614d0c729d7b9d8e5d2df66325c4cede02d9..9652f70cc0096e844f4ae7767bc36cbf19e2a1a6 100644 (file)
@@ -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;