Skip to content

Commit

Permalink
qrmode: fix potential memory leak in psbt failure case
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieDriver committed Apr 30, 2024
1 parent c41eb15 commit 1e5f9d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main/qrmode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1082,12 +1082,13 @@ static bool parse_sign_display_bcur_psbt_qr(const uint8_t* cbor, const size_t cb
size_t cbor_signed_len = 0;
if (!bcur_build_cbor_crypto_psbt(psbt, &cbor_signed, &cbor_signed_len)) {
JADE_LOGW("Failed to build bcur/cbor for psbt");
return false;
goto cleanup;
}

// Now display bcur QR
const char* message[] = { "Scan with", "wallet", "app" };
display_bcur_qr(message, 3, BCUR_TYPE_CRYPTO_PSBT, cbor_signed, cbor_signed_len, "blkstrm.com/psbt");
ret = true;

cleanup:
JADE_WALLY_VERIFY(wally_psbt_free(psbt));
Expand Down

0 comments on commit 1e5f9d1

Please sign in to comment.