From: Brendan Cully Date: Sun, 22 Jul 2012 18:15:30 +0000 (-0700) Subject: mutt_buffer_init: just memset the buffer (closes #3588) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df02c8047163d09cfd77a6732070cec251a10ad8;p=mutt mutt_buffer_init: just memset the buffer (closes #3588) This was meant to be part of the previous commit. --- diff --git a/muttlib.c b/muttlib.c index 725a105d..7e93a3a2 100644 --- a/muttlib.c +++ b/muttlib.c @@ -1657,21 +1657,8 @@ BUFFER *mutt_buffer_new(void) { return b; } -/* - * Creates and initializes a BUFFER*. If passed an existing BUFFER*, - * just initializes. Frees anything already in the buffer. - * - * Disregards the 'destroy' flag, which seems reserved for caller. - * This is bad, but there's no apparent protocol for it. - */ +/* initialize a new BUFFER */ BUFFER *mutt_buffer_init (BUFFER *b) { - if (!b) { - b = safe_malloc(sizeof(BUFFER)); - if (!b) - return NULL ; - } else { - FREE(&b->data); - } memset(b, 0, sizeof(BUFFER)); return b; }