Skip to content

Commit 64ca9fa

Browse files
committed
Fixed 'use after delete' bug found by Mark
1 parent 81e0de9 commit 64ca9fa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/remote/remote.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,8 @@ void Rtr::setupInlineBlob(P_INLINE_BLOB* p_blob)
989989
fb_assert(blb->rbl_data.getCount() <= MAX_USHORT);
990990

991991
blb->rbl_buffer_length = MIN(MAX_USHORT, blb->rbl_data.getCapacity());
992-
if (!rtr_rdb->incBlobCache(blb->getCachedSize()))
992+
const ULONG cachedSize = blb->getCachedSize();
993+
if (!rtr_rdb->incBlobCache(cachedSize))
993994
{
994995
delete blb;
995996
return;
@@ -1005,7 +1006,7 @@ void Rtr::setupInlineBlob(P_INLINE_BLOB* p_blob)
10051006
fb_assert(blb != old);
10061007
delete blb;
10071008

1008-
rtr_rdb->decBlobCache(blb->getCachedSize());
1009+
rtr_rdb->decBlobCache(cachedSize);
10091010
return;
10101011
}
10111012

0 commit comments

Comments
 (0)