mirror of
https://github.com/systemd/systemd.git
synced 2025-03-31 14:50:15 +03:00
Merge pull request #916 from reverendhomer/patch-3
libsystemd-network: fix memory leak
This commit is contained in:
commit
aae68db9b4
@ -954,7 +954,7 @@ int sd_dhcp_lease_load(sd_dhcp_lease **ret, const char *lease_file) {
|
||||
}
|
||||
|
||||
for (i = 0; i <= DHCP_OPTION_PRIVATE_LAST - DHCP_OPTION_PRIVATE_BASE; i++) {
|
||||
uint8_t *data;
|
||||
_cleanup_free_ uint8_t *data = NULL;
|
||||
size_t len;
|
||||
|
||||
if (!options[i])
|
||||
@ -965,10 +965,8 @@ int sd_dhcp_lease_load(sd_dhcp_lease **ret, const char *lease_file) {
|
||||
return r;
|
||||
|
||||
r = dhcp_lease_insert_private_option(lease, DHCP_OPTION_PRIVATE_BASE + i, data, len);
|
||||
if (r < 0) {
|
||||
free(data);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
*ret = lease;
|
||||
|
Loading…
x
Reference in New Issue
Block a user