]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: make neighbor_free() return NULL
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 29 Sep 2020 15:45:19 +0000 (00:45 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 6 Oct 2020 17:44:42 +0000 (02:44 +0900)
src/network/networkd-neighbor.c
src/network/networkd-neighbor.h

index 908fc1c11c2c2953d86f20028e78b4437ef39941..c14c8f7e06f3178475f09f18f5d4e354def13659 100644 (file)
@@ -9,9 +9,9 @@
 #include "networkd-network.h"
 #include "set.h"
 
-void neighbor_free(Neighbor *neighbor) {
+Neighbor *neighbor_free(Neighbor *neighbor) {
         if (!neighbor)
-                return;
+                return NULL;
 
         if (neighbor->network) {
                 assert(neighbor->section);
@@ -25,7 +25,7 @@ void neighbor_free(Neighbor *neighbor) {
                 set_remove(neighbor->link->neighbors_foreign, neighbor);
         }
 
-        free(neighbor);
+        return mfree(neighbor);
 }
 
 DEFINE_NETWORK_SECTION_FUNCTIONS(Neighbor, neighbor_free);
index 0c3dfc830310cc5ff1ab932f3d84ec687114fecd..f40fdccc4817fa6cf49dc10a20fce4efea85b426 100644 (file)
@@ -30,7 +30,7 @@ typedef struct Neighbor {
         size_t lladdr_size;
 } Neighbor;
 
-void neighbor_free(Neighbor *neighbor);
+Neighbor *neighbor_free(Neighbor *neighbor);
 
 void network_verify_neighbors(Network *network);