summaryrefslogtreecommitdiff
path: root/lib/util
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util')
-rw-r--r--lib/util/Makemodule.am2
-rw-r--r--lib/util/alloc.c38
2 files changed, 1 insertions, 39 deletions
diff --git a/lib/util/Makemodule.am b/lib/util/Makemodule.am
index 426e088..0ee762b 100644
--- a/lib/util/Makemodule.am
+++ b/lib/util/Makemodule.am
@@ -1,4 +1,4 @@
-libutil_la_SOURCES = include/util/util.h lib/util/alloc.c
+libutil_la_SOURCES = include/util/util.h
libutil_la_CFLAGS = $(AM_CFLAGS)
libutil_la_CPPFLAGS = $(AM_CPPFLAGS)
libutil_la_LDFLAGS = $(AM_LDFLAGS)
diff --git a/lib/util/alloc.c b/lib/util/alloc.c
deleted file mode 100644
index 526a4d5..0000000
--- a/lib/util/alloc.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* SPDX-License-Identifier: LGPL-3.0-or-later */
-/*
- * alloc.c
- *
- * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>
- */
-#include "config.h"
-
-#include "util/util.h"
-
-#include <stddef.h>
-#include <stdlib.h>
-#include <errno.h>
-
-void *alloc_flex(size_t base_size, size_t item_size, size_t nmemb)
-{
- size_t size;
-
- if (SZ_MUL_OV(nmemb, item_size, &size) ||
- SZ_ADD_OV(base_size, size, &size)) {
- errno = EOVERFLOW;
- return NULL;
- }
-
- return calloc(1, size);
-}
-
-void *alloc_array(size_t item_size, size_t nmemb)
-{
- size_t size;
-
- if (SZ_MUL_OV(nmemb, item_size, &size)) {
- errno = EOVERFLOW;
- return NULL;
- }
-
- return calloc(1, size);
-}