Properly initialize ICAO cached addresses hash table.

This commit is contained in:
antirez 2013-01-26 01:15:15 +01:00
parent c2e79d4555
commit 11d8db0d38

View file

@ -294,7 +294,7 @@ void modesInit(void) {
/* Allocate the ICAO address cache. We use two uint32_t for every /* Allocate the ICAO address cache. We use two uint32_t for every
* entry because it's a addr / timestamp pair for every entry. */ * entry because it's a addr / timestamp pair for every entry. */
Modes.icao_cache = malloc(sizeof(uint32_t)*MODES_ICAO_CACHE_LEN*2); Modes.icao_cache = malloc(sizeof(uint32_t)*MODES_ICAO_CACHE_LEN*2);
memset(Modes.icao_cache,0,sizeof(Modes.icao_cache)); memset(Modes.icao_cache,0,sizeof(uint32_t)*MODES_ICAO_CACHE_LEN*2);
Modes.aircrafts = NULL; Modes.aircrafts = NULL;
Modes.interactive_last_update = 0; Modes.interactive_last_update = 0;
if ((Modes.data = malloc(Modes.data_len)) == NULL || if ((Modes.data = malloc(Modes.data_len)) == NULL ||