From 12f78d8030ba847902e39a87e107c3ee7cdc57a3 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Tue, 21 Nov 2017 16:59:48 +0000 Subject: [PATCH] remove unnecessary alloc checks --- conn/ssl_gnutls.c | 8 ++------ imap/util.c | 5 ----- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/conn/ssl_gnutls.c b/conn/ssl_gnutls.c index b64f9e087..4e3e8811e 100644 --- a/conn/ssl_gnutls.c +++ b/conn/ssl_gnutls.c @@ -992,12 +992,8 @@ static void tls_get_client_cert(struct Connection *conn) /* get length of DN */ dnlen = 0; gnutls_x509_crt_get_dn(clientcrt, NULL, &dnlen); - dn = calloc(1, dnlen); - if (!dn) - { - mutt_debug(1, "could not allocate DN\n"); - goto err_crt; - } + dn = mutt_mem_calloc(1, dnlen); + gnutls_x509_crt_get_dn(clientcrt, dn, &dnlen); mutt_debug(2, "client certificate DN: %s\n", dn); diff --git a/imap/util.c b/imap/util.c index 1e93176dc..db3da95d8 100644 --- a/imap/util.c +++ b/imap/util.c @@ -622,11 +622,6 @@ struct ImapData *imap_new_idata(void) idata->cmdslots = ImapPipelineDepth + 2; idata->cmds = mutt_mem_calloc(idata->cmdslots, sizeof(*idata->cmds)); - if (!idata->cmds) - { - mutt_buffer_free(&idata->cmdbuf); - FREE(&idata); - } STAILQ_INIT(&idata->flags); STAILQ_INIT(&idata->mboxcache); -- 2.49.0