n-dhcp4: allocate memory of right size in n_dhcp4_client_probe_option_new()

Non-critical, as the allocated memory was larger than needed.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/224
This commit is contained in:
Thomas Haller 2019-08-08 07:46:01 +02:00
parent 1b59d752be
commit b80b25050f

View file

@ -26,7 +26,7 @@ static int n_dhcp4_client_probe_option_new(NDhcp4ClientProbeOption **optionp,
uint8_t n_data) {
NDhcp4ClientProbeOption *op;
op = malloc(sizeof(op) + n_data);
op = malloc(sizeof(*op) + n_data);
if (!op)
return -ENOMEM;