check malloc() - iomenu - interactive terminal-based selection menu
HTML git clone git://bitreich.org/iomenu git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/iomenu
DIR Log
DIR Files
DIR Refs
DIR Tags
DIR README
DIR LICENSE
---
DIR commit e844872a71215b44a5e7c8fe7f98508f9bccc5c5
DIR parent e62b3c99fc9a7198c96ef70e15ad84c73534c84b
HTML Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Wed, 29 Nov 2017 20:57:16 +0100
check malloc()
Diffstat:
M iomenu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
DIR diff --git a/iomenu.c b/iomenu.c
@@ -119,7 +119,8 @@ read_stdin(void)
size = BUFSIZ;
off = 0;
- buf = malloc(size);
+ if (!(buf = malloc(size)))
+ die("malloc");
while ((len = read(STDIN_FILENO, buf + off, size - off)) > 0) {
off += len;
if (off >= size >> 1) {