mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 04:32:37 +01:00
unit: memset band to zero after alloc
In test-band the band object was allocated using l_malloc, but not memset to zero. This will cause problems if allocated pointers are included in struct band once band is freed.
This commit is contained in:
parent
6c6bfb3d16
commit
7f63872dcf
@ -52,6 +52,8 @@ static struct band *new_band()
|
||||
/* band + 8 basic rates */
|
||||
struct band *band = l_malloc(sizeof(struct band) + 8);
|
||||
|
||||
memset(band, 0, sizeof(struct band) + 8);
|
||||
|
||||
band->supported_rates_len = 8;
|
||||
band->supported_rates[0] = 12;
|
||||
band->supported_rates[1] = 18;
|
||||
|
Loading…
Reference in New Issue
Block a user