artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e163d0c
)
aucat: check for failled allocation
author
ratchov
<ratchov@openbsd.org>
Mon, 8 Jul 2024 16:10:34 +0000
(16:10 +0000)
committer
ratchov
<ratchov@openbsd.org>
Mon, 8 Jul 2024 16:10:34 +0000
(16:10 +0000)
From Nihal Jere <nihal@nihaljere.xyz>, thanks!
usr.bin/aucat/aucat.c
patch
|
blob
|
history
diff --git
a/usr.bin/aucat/aucat.c
b/usr.bin/aucat/aucat.c
index
a9b5986
..
3c50138
100644
(file)
--- a/
usr.bin/aucat/aucat.c
+++ b/
usr.bin/aucat/aucat.c
@@
-147,13
+147,18
@@
static void *
allocbuf(int nfr, int nch, int bps)
{
size_t fsize;
+ void *ptr;
if (nch < 0 || nch > NCHAN_MAX || bps < 0 || bps > 4) {
log_puts("allocbuf: bogus channels or bytes per sample count\n");
panic();
}
fsize = nch * bps;
- return reallocarray(NULL, nfr, fsize);
+
+ ptr = reallocarray(NULL, nfr, fsize);
+ if (ptr == NULL)
+ err(1, "reallocarray");
+ return ptr;
}
static void