Skip to content

Commit 78655c1

Browse files
siv2rdderjoel
authored andcommitted
scratch_destroy: move VERIFY_CHECK after invalid scrach space check
1 parent 13754aa commit 78655c1

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)