Skip to content

Commit f3eb280

Browse files
committed
CCBC-1673: do not return block with deallocs as free
Change-Id: I063a84fa9f255918d8a44568c52025bd69429c19 Reviewed-on: https://review.couchbase.org/c/libcouchbase/+/232550 Tested-by: Build Bot <build@couchbase.com> Reviewed-by: Michael Reiche <michael.reiche@couchbase.com>
1 parent ece5db1 commit f3eb280

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/netbuf/netbuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static nb_MBLOCK *find_free_block(nb_MBPOOL *pool, nb_SIZE capacity)
125125
SLLIST_ITERFOR(&pool->avail, &iter)
126126
{
127127
nb_MBLOCK *cur = SLLIST_ITEM(iter.cur, nb_MBLOCK, slnode);
128-
if (cur->nalloc >= capacity) {
128+
if (cur->nalloc >= capacity && !BLOCK_HAS_DEALLOCS(cur)) {
129129
sllist_iter_remove(&pool->avail, &iter);
130130
pool->curblocks--;
131131
return cur;

0 commit comments

Comments
 (0)