diff options
| author | Philippe Charnier <charnier@FreeBSD.org> | 2000-01-23 20:25:01 +0000 |
|---|---|---|
| committer | Philippe Charnier <charnier@FreeBSD.org> | 2000-01-23 20:25:01 +0000 |
| commit | bb897a8710b86716b40c490bde8e909c9af48760 (patch) | |
| tree | 3983a883fc26c2ffa7a1c42f482da14c5feb0bd7 /usr.sbin/tzsetup | |
| parent | e6df6417f2e92ec5124a4220dd7c7531c5797f2c (diff) | |
Notes
Diffstat (limited to 'usr.sbin/tzsetup')
| -rw-r--r-- | usr.sbin/tzsetup/tzsetup.8 | 2 | ||||
| -rw-r--r-- | usr.sbin/tzsetup/tzsetup.c | 16 |
2 files changed, 14 insertions, 4 deletions
diff --git a/usr.sbin/tzsetup/tzsetup.8 b/usr.sbin/tzsetup/tzsetup.8 index 3bf3f66815cd..4bdfed2c0b93 100644 --- a/usr.sbin/tzsetup/tzsetup.8 +++ b/usr.sbin/tzsetup/tzsetup.8 @@ -118,7 +118,7 @@ mapping of timezone file to country and location .Xr tzfile 5 , .Xr adjkerntz 8 , .Xr zdump 8 , -.Xr zic 8 . +.Xr zic 8 .Sh DISCLAIMER The representation of certain localities as being associated with certain countries and/or territories is for the purposes of identification only, diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c index c1aafd5543a8..a513870c5251 100644 --- a/usr.sbin/tzsetup/tzsetup.c +++ b/usr.sbin/tzsetup/tzsetup.c @@ -216,7 +216,11 @@ read_iso3166_table(void) ":%d: country code `%s' multiply defined: %s", lineno, t, cp->name); cp->name = strdup(name); + if (cp->name == NULL) + errx(1, "malloc failed"); cp->tlc = strdup(t); + if (cp->tlc == NULL) + errx(1, "malloc failed"); } fclose(fp); @@ -245,13 +249,17 @@ add_zone_to_country(int lineno, const char *tlc, const char *descr, zp = malloc(sizeof *zp); if (zp == 0) - err(1, "malloc(%lu)", (unsigned long)sizeof *zp); + errx(1, "malloc(%lu)", (unsigned long)sizeof *zp); if (cp->nzones == 0) TAILQ_INIT(&cp->zones); zp->descr = strdup(descr); + if (zp->descr == NULL) + errx(1, "malloc failed"); zp->filename = strdup(file); + if (zp->filename == NULL) + errx(1, "malloc failed"); zp->continent = cont; TAILQ_INSERT_TAIL(&cp->zones, zp, link); cp->nzones++; @@ -264,6 +272,8 @@ add_zone_to_country(int lineno, const char *tlc, const char *descr, ":%d: zone multiply defined", lineno); cp->nzones = -1; cp->filename = strdup(file); + if (cp->filename == NULL) + errx(1, "malloc failed"); cp->continent = cont; } } @@ -390,7 +400,7 @@ make_menus(void) malloc(sizeof(dialogMenuItem) * continent_names[i].continent->nitems); if (continent_names[i].continent->menu == 0) - err(1, "malloc for continent menu"); + errx(1, "malloc for continent menu"); continent_names[i].continent->nitems = 0; } @@ -415,7 +425,7 @@ make_menus(void) } else { cp->submenu = malloc(cp->nzones * sizeof *dmi); if (cp->submenu == 0) - err(1, "malloc for submenu"); + errx(1, "malloc for submenu"); cp->nzones = 0; for (zp = cp->zones.tqh_first; zp; zp = zp->link.tqe_next) { |
