MCPcopy Create free account
hub / github.com/eggert/tz / tzalloc

Function tzalloc

localtime.c:2009–2023  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2007#if NETBSD_INSPIRED && !USE_TIMEX_T
2008
2009timezone_t
2010tzalloc(char const *name)
2011{
2012 timezone_t sp = malloc(sizeof *sp);
2013 if (sp) {
2014 int err = zoneinit(sp, name, TZLOAD_TZSTRING);
2015 if (err != 0) {
2016 free(sp);
2017 errno = err;
2018 return NULL;
2019 }
2020 } else if (!HAVE_MALLOC_ERRNO)
2021 errno = ENOMEM;
2022 return sp;
2023}
2024
2025#ifndef FREE_PRESERVES_ERRNO
2026# if ((defined _POSIX_VERSION && 202405 <= _POSIX_VERSION) \

Callers

nothing calls this directly

Calls 1

zoneinitFunction · 0.85

Tested by

no test coverage detected