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.
int rc;
int count = 0;
- if (! (cmd = mutt_buffer_new ()))
- {
- dprint (1, (debugfile, "imap_exec_msgset: unable to allocate buffer\n"));
- return -1;
- }
+ cmd = mutt_buffer_new ();
/* We make a copy of the headers just in case resorting doesn't give
exactly the original order (duplicate messages?), because other parts of
mutt_sleep (2);
}
-/* imap_new_idata: Allocate and initialise a new IMAP_DATA structure.
- * Returns NULL on failure (no mem) */
+/* imap_new_idata: Allocate and initialise a new IMAP_DATA structure. */
IMAP_DATA* imap_new_idata (void)
{
IMAP_DATA* idata = safe_calloc (1, sizeof (IMAP_DATA));
- if (!idata)
- return NULL;
-
- if (!(idata->cmdbuf = mutt_buffer_new ()))
- FREE (&idata);
-
+ idata->cmdbuf = mutt_buffer_new ();
idata->cmdslots = ImapPipelineDepth + 2;
- if (!(idata->cmds = safe_calloc(idata->cmdslots, sizeof(*idata->cmds))))
- {
- mutt_buffer_free(&idata->cmdbuf);
- FREE (&idata);
- }
+ idata->cmds = safe_calloc (idata->cmdslots, sizeof(*idata->cmds));
return idata;
}
char *p = *s;
mbstate_t mbstate1, mbstate2;
- if (!(b = mutt_buffer_new ()))
- return -1;
+ b = mutt_buffer_new ();
memset (&mbstate1, 0, sizeof (mbstate1));
memset (&mbstate2, 0, sizeof (mbstate2));
for (; (k = mbrtowc (&wc, p, MB_LEN_MAX, &mbstate1)); p += k)