summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/sntp/kod_management.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ntp/sntp/kod_management.c')
-rw-r--r--contrib/ntp/sntp/kod_management.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/ntp/sntp/kod_management.c b/contrib/ntp/sntp/kod_management.c
index c8df3bd..b378bf2 100644
--- a/contrib/ntp/sntp/kod_management.c
+++ b/contrib/ntp/sntp/kod_management.c
@@ -246,6 +246,7 @@ kod_init_kod_db(
rewind(db_s);
+ /* Allocate the array of pointers to the struct kod_entry items */
kod_db = eallocarray(kod_db_cnt, sizeof(kod_db[0]));
/* Read contents of file */
@@ -265,7 +266,8 @@ kod_init_kod_db(
continue;
}
- kod_db[b] = emalloc(sizeof(*kod_db[b]));
+ /* Allocate this struct kod_entry item */
+ kod_db[b] = emalloc(sizeof(*kod_db[0]));
if (3 != sscanf(fbuf, "%llx %4s %254s", &ull,
kod_db[b]->type, kod_db[b]->hostname)) {
OpenPOWER on IntegriCloud