]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: buffer_free(NULL) should be a no-op
authorJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Tue, 19 Sep 2017 10:26:57 +0000 (13:26 +0300)
committerJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Wed, 20 Sep 2017 09:29:06 +0000 (12:29 +0300)
src/lib/buffer.c

index 0668ad3bed8456d48f2cff4b3272dd2e38017585..7ea84100ac0528475eefc5eea34584b809eb1fa8 100644 (file)
@@ -148,6 +148,9 @@ void buffer_free(buffer_t **_buf)
 {
        struct real_buffer *buf = (struct real_buffer *)*_buf;
 
+       if (buf == NULL)
+               return;
+
        *_buf = NULL;
        if (buf->alloced)
                p_free(buf->pool, buf->w_buffer);