aboutsummaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-03-31 16:32:18 +0000
committerOmar Polo <op@omarpolo.com>2021-03-31 16:32:18 +0000
commitb8e64ccd44290cdd34bdcd3fd85fb1a9cb7486dd (patch)
tree0e419f355bb2bda7a099fd1c113e1c04f7dfe723 /utils.c
parente0ebdf2d94159db669a67972b760d1920f11310b (diff)
list instead of fixed-size array for vhosts and locations
saves some bytes of memory and removes the limit on the maximum number of vhosts and location blocks.
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/utils.c b/utils.c
index 5d831f1..1fda993 100644
--- a/utils.c
+++ b/utils.c
@@ -96,6 +96,16 @@ xstrdup(const char *s)
return d;
}
+void *
+xcalloc(size_t nmemb, size_t size)
+{
+ void *d;
+
+ if ((d = calloc(nmemb, size)) == NULL)
+ err(1, "calloc");
+ return d;
+}
+
void
gen_certificate(const char *hostname, const char *certpath, const char *keypath)
{