]> granicus.if.org Git - neomutt/commitdiff
Add alloc fail check in nntp_fetch_headers
authorJerikoOne <jeriko.one@gmx.us>
Tue, 3 Jul 2018 22:22:12 +0000 (17:22 -0500)
committerRichard Russon <rich@flatcap.org>
Wed, 4 Jul 2018 16:42:30 +0000 (17:42 +0100)
nntp.c

diff --git a/nntp.c b/nntp.c
index 032b6e141dd2c0d2f6f6afaa6e42e7fe35220f94..a0ffa609cb56c8b4909a3c8db2584ac5fdebb4c8 100644 (file)
--- a/nntp.c
+++ b/nntp.c
@@ -1288,6 +1288,8 @@ static int nntp_fetch_headers(struct Context *ctx, void *hc, anum_t first,
   fc.last = last;
   fc.restore = restore;
   fc.messages = mutt_mem_calloc(last - first + 1, sizeof(unsigned char));
+  if (fc.messages == NULL)
+         return -1;
 #ifdef USE_HCACHE
   fc.hc = hc;
 #endif