summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
authorPierre Pronchery <pierre@freebsdfoundation.org>2023-05-04 21:51:47 +0000
committerEd Maste <emaste@FreeBSD.org>2023-05-05 15:12:07 +0000
commitcf3e3d5bd0a1fae39c74c7db5a4e8b10732d0766 (patch)
tree4c48b81a8fc4921e6e584787f31f0b80af5bcf32 /buffer.c
parentc6342fe2e90510d8d2296423f2ca92818a7b3d18 (diff)
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/buffer.c b/buffer.c
index e008831fcc37..8f6aab59eaac 100644
--- a/buffer.c
+++ b/buffer.c
@@ -63,6 +63,7 @@ ldns_buffer_set_capacity(ldns_buffer *buffer, size_t capacity)
ldns_buffer_invariant(buffer);
assert(buffer->_position <= capacity);
+ assert(!buffer->_fixed);
data = (uint8_t *) LDNS_XREALLOC(buffer->_data, uint8_t, capacity);
if (!data) {
@@ -79,7 +80,6 @@ bool
ldns_buffer_reserve(ldns_buffer *buffer, size_t amount)
{
ldns_buffer_invariant(buffer);
- assert(!buffer->_fixed);
if (buffer->_capacity < buffer->_position + amount) {
size_t new_capacity = buffer->_capacity * 3 / 2;