diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-09-24 23:45:13 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-09-29 15:29:40 +0900 |
commit | 5cf67bb4072f149d0404398bfc359b068312ba28 (patch) | |
tree | 1728f8ce80765e93e6168cd5398a8d067ad3f4ba /src | |
parent | edeee50b3dfccc716ffee23cfc2f2a221ed09339 (diff) | |
download | systemd-5cf67bb4072f149d0404398bfc359b068312ba28.tar.gz |
sd-dhcp6-client: make dhcp6_lease_free() accepts NULL
Diffstat (limited to 'src')
-rw-r--r-- | src/libsystemd-network/sd-dhcp6-lease.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/libsystemd-network/sd-dhcp6-lease.c b/src/libsystemd-network/sd-dhcp6-lease.c index b69f59c84d..aaafed661b 100644 --- a/src/libsystemd-network/sd-dhcp6-lease.c +++ b/src/libsystemd-network/sd-dhcp6-lease.c @@ -358,20 +358,18 @@ int sd_dhcp6_lease_get_fqdn(sd_dhcp6_lease *lease, const char **ret) { } static sd_dhcp6_lease *dhcp6_lease_free(sd_dhcp6_lease *lease) { - assert(lease); + if (!lease) + return NULL; free(lease->serverid); dhcp6_lease_free_ia(&lease->ia); dhcp6_lease_free_ia(&lease->pd); - free(lease->dns); free(lease->fqdn); - - lease->domains = strv_free(lease->domains); - + strv_free(lease->domains); free(lease->ntp); + strv_free(lease->ntp_fqdn); - lease->ntp_fqdn = strv_free(lease->ntp_fqdn); return mfree(lease); } |