summaryrefslogtreecommitdiffstats
path: root/src/color.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-06-19 12:11:36 -0400
committerTavian Barnes <tavianator@tavianator.com>2023-06-20 14:26:09 -0400
commit90ded13e589b0089167ef25ca3d26be599dfec9b (patch)
treed5a007948587f62fff62c851ddd3886b5a5e78ed /src/color.c
parent9ceb2b27577f1be3f30edb40a45117066fc78c51 (diff)
downloadbfs-90ded13e589b0089167ef25ca3d26be599dfec9b.tar.xz
alloc: New header for memory allocation utilities
Diffstat (limited to 'src/color.c')
-rw-r--r--src/color.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/color.c b/src/color.c
index 1edd8b5..b54ad53 100644
--- a/src/color.c
+++ b/src/color.c
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: 0BSD
#include "color.h"
+#include "alloc.h"
#include "bfstd.h"
#include "bftw.h"
#include "config.h"
@@ -404,7 +405,7 @@ static void parse_gnu_ls_colors(struct colors *colors, const char *ls_colors) {
}
struct colors *parse_colors(void) {
- struct colors *colors = malloc(sizeof(struct colors));
+ struct colors *colors = ALLOC(struct colors);
if (!colors) {
return NULL;
}
@@ -497,7 +498,7 @@ void free_colors(struct colors *colors) {
}
CFILE *cfwrap(FILE *file, const struct colors *colors, bool close) {
- CFILE *cfile = malloc(sizeof(*cfile));
+ CFILE *cfile = ALLOC(CFILE);
if (!cfile) {
return NULL;
}