Commit 63cb8a0a authored by Kevin J. McCarthy's avatar Kevin J. McCarthy

Remove mutt_buffer_new() NULL retval checks.

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.
parent a001b1d3
Pipeline #22403924 passed with stages
in 15 minutes and 19 seconds
......@@ -1017,11 +1017,7 @@ int imap_exec_msgset (IMAP_DATA* idata, const char* pre, const char* post,
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
......
......@@ -364,24 +364,14 @@ void imap_error (const char *where, const char *msg)
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;
}
......
......@@ -549,8 +549,7 @@ int mutt_filter_unprintable (char **s)
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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment