Skip to content

Commit accadc9

Browse files
committed
Merge bitcoin-core#1114: _scratch_destroy: move VERIFY_CHECK after invalid scrach space check
1827c9b scratch_destroy: move VERIFY_CHECK after invalid scrach space check (siv2r) Pull request description: ACKs for top commit: sipa: utACK 1827c9b jonasnick: ACK 1827c9b Tree-SHA512: 5c4f97ca16f46380b30d1d077a54e25eab21efb10e0ce3ca27e7f73a2318d130f0f0773e26b2fdfc8f9d98c1334880f9d80a51b0941be3ba0af2b656b7c0ea7e
2 parents cd47033 + 1827c9b commit accadc9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/scratch_impl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ static secp256k1_scratch* secp256k1_scratch_create(const secp256k1_callback* err
2525

2626
static void secp256k1_scratch_destroy(const secp256k1_callback* error_callback, secp256k1_scratch* scratch) {
2727
if (scratch != NULL) {
28-
VERIFY_CHECK(scratch->alloc_size == 0); /* all checkpoints should be applied */
2928
if (secp256k1_memcmp_var(scratch->magic, "scratch", 8) != 0) {
3029
secp256k1_callback_call(error_callback, "invalid scratch space");
3130
return;
3231
}
32+
VERIFY_CHECK(scratch->alloc_size == 0); /* all checkpoints should be applied */
3333
memset(scratch->magic, 0, sizeof(scratch->magic));
3434
free(scratch);
3535
}

0 commit comments

Comments
 (0)