]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: make address_free() return NULL
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 2 Oct 2020 03:18:37 +0000 (12:18 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 6 Oct 2020 17:50:50 +0000 (02:50 +0900)
src/network/networkd-address.c
src/network/networkd-address.h

index 3f985c849f414e1a627c19f36cba0b22edc78708..d14da8195e1525586e567ba5e7732a5b9caf9007 100644 (file)
@@ -110,9 +110,9 @@ static int address_new_static(Network *network, const char *filename, unsigned s
         return 0;
 }
 
-void address_free(Address *address) {
+Address *address_free(Address *address) {
         if (!address)
-                return;
+                return NULL;
 
         if (address->network) {
                 LIST_REMOVE(addresses, address->network->static_addresses, address);
@@ -149,7 +149,7 @@ void address_free(Address *address) {
 
         network_config_section_free(address->section);
         free(address->label);
-        free(address);
+        return mfree(address);
 }
 
 static uint32_t address_prefix(const Address *a) {
index a78fadc885cfec31a790780bd7dc310491a647df..097cafc3150301b883e04ac2c1ad1a79e8faf01e 100644 (file)
@@ -57,7 +57,7 @@ struct Address {
 };
 
 int address_new(Address **ret);
-void address_free(Address *address);
+Address *address_free(Address *address);
 int address_add_foreign(Link *link, int family, const union in_addr_union *in_addr, unsigned char prefixlen, Address **ret);
 int address_add(Link *link, int family, const union in_addr_union *in_addr, unsigned char prefixlen, Address **ret);
 int address_get(Link *link, int family, const union in_addr_union *in_addr, unsigned char prefixlen, Address **ret);