summaryrefslogtreecommitdiff
path: root/payloads/libpayload/libc/readline.c
diff options
context:
space:
mode:
Diffstat (limited to 'payloads/libpayload/libc/readline.c')
-rw-r--r--payloads/libpayload/libc/readline.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/payloads/libpayload/libc/readline.c b/payloads/libpayload/libc/readline.c
index 01a565a698..9387e09149 100644
--- a/payloads/libpayload/libc/readline.c
+++ b/payloads/libpayload/libc/readline.c
@@ -55,6 +55,8 @@ char *readline(const char *prompt)
if (!readline_buffer || !readline_bufferlen) {
#define READLINE_BUFFERSIZE 256
readline_buffer = malloc(READLINE_BUFFERSIZE);
+ if (!readline_buffer)
+ return NULL;
readline_bufferlen = READLINE_BUFFERSIZE;
memset(readline_buffer, 0, readline_bufferlen);
}