]> granicus.if.org Git - neomutt/commitdiff
Remove mutt_buffer_new() NULL retval checks.
authorKevin McCarthy <kevin@8t8.us>
Mon, 21 May 2018 22:12:47 +0000 (15:12 -0700)
committerRichard Russon <rich@flatcap.org>
Tue, 29 May 2018 02:00:25 +0000 (03:00 +0100)
It will fail, rather than return NULL.

Further clean up imap_new_data() since it also had NULL checks for
safe_calloc() that shouldn't happen.

imap/imap.c
imap/util.c
mutt/mbyte.c

index 8cd31c6c8e1764c2086d9e9674589188a998fd04..9353a94f6980e9038600e4aa9ecdc6bd84409e81 100644 (file)
@@ -1180,11 +1180,6 @@ int imap_exec_msgset(struct ImapData *idata, const char *pre, const char *post,
   int count = 0;
 
   struct Buffer *cmd = mutt_buffer_new();
-  if (!cmd)
-  {
-    mutt_debug(1, "unable to allocate buffer\n");
-    return -1;
-  }
 
   /* We make a copy of the headers just in case resorting doesn't give
    exactly the original order (duplicate messages?), because other parts of
index 2328beca19c1b51aac9ae5e3beb4e92fe1ab6f9f..2d88f511740567160dffb51df93ee49d958fba13 100644 (file)
@@ -581,9 +581,6 @@ struct ImapData *imap_new_idata(void)
   struct ImapData *idata = mutt_mem_calloc(1, sizeof(struct ImapData));
 
   idata->cmdbuf = mutt_buffer_new();
-  if (!idata->cmdbuf)
-    FREE(&idata);
-
   idata->cmdslots = ImapPipelineDepth + 2;
   idata->cmds = mutt_mem_calloc(idata->cmdslots, sizeof(*idata->cmds));
 
index 3b2953ec50be7b380a1e72363d18644d1920e5f9..d992d4cda1be6eeba0dd7828b13f6b70eddf9d50 100644 (file)
@@ -414,8 +414,6 @@ int mutt_mb_filter_unprintable(char **s)
   mbstate_t mbstate1, mbstate2;
 
   struct Buffer *b = mutt_buffer_new();
-  if (!b)
-    return -1;
   memset(&mbstate1, 0, sizeof(mbstate1));
   memset(&mbstate2, 0, sizeof(mbstate2));
   for (; (k = mbrtowc(&wc, p, MB_LEN_MAX, &mbstate1)); p += k)