network: make address_label_free() return NULL

This commit is contained in:
Yu Watanabe 2020-09-30 01:25:12 +09:00
parent d6a2a0f9a7
commit cae418a306
2 changed files with 4 additions and 4 deletions

View file

@ -11,9 +11,9 @@
#include "parse-util.h"
#include "socket-util.h"
void address_label_free(AddressLabel *label) {
AddressLabel *address_label_free(AddressLabel *label) {
if (!label)
return;
return NULL;
if (label->network) {
assert(label->section);
@ -21,7 +21,7 @@ void address_label_free(AddressLabel *label) {
}
network_config_section_free(label->section);
free(label);
return mfree(label);
}
static int address_label_new_static(Network *network, const char *filename, unsigned section_line, AddressLabel **ret) {

View file

@ -27,7 +27,7 @@ struct AddressLabel {
union in_addr_union in_addr;
};
void address_label_free(AddressLabel *label);
AddressLabel *address_label_free(AddressLabel *label);
DEFINE_NETWORK_SECTION_FUNCTIONS(AddressLabel, address_label_free);