libsystemd-network: avoid double free on error

This could happen if the remote sent us a badly formatted
option.

CID #1317206.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2016-01-20 18:55:55 -05:00
parent b14fff6e44
commit 63a54aa15e
+1 -1
View File
@@ -256,7 +256,7 @@ int dhcp6_lease_set_ntp(sd_dhcp6_lease *lease, uint8_t *optval, size_t optlen) {
assert_return(lease, -EINVAL);
assert_return(optval, -EINVAL);
free(lease->ntp);
lease->ntp = mfree(lease->ntp);
lease->ntp_count = 0;
lease->ntp_allocated = 0;