mirror of
https://github.com/logos-blockchain/logos-blockchain-module.git
synced 2026-02-19 20:43:12 +00:00
Fix double free
This commit is contained in:
parent
214a878851
commit
0824823598
6
flake.lock
generated
6
flake.lock
generated
@ -23,11 +23,11 @@
|
||||
"rust-overlay": "rust-overlay"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1771418281,
|
||||
"narHash": "sha256-9nATUijKs7OCEcepHKghuWdgHu+hq11JbJz2Lv4uyDU=",
|
||||
"lastModified": 1771428592,
|
||||
"narHash": "sha256-J0bJOaHNUh7yDXLw4UajReywSSvN36JiY+e6tPMvqwM=",
|
||||
"owner": "logos-blockchain",
|
||||
"repo": "logos-blockchain",
|
||||
"rev": "b862e6f640a79097b8a42c072e1f78bc430fa222",
|
||||
"rev": "7a15c6474a5f9b7c12a36f43e3858b8dcf27ee40",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@ -31,7 +31,9 @@ void LogosBlockchainModule::onNewBlockCallback(const char* block) {
|
||||
QVariantList data;
|
||||
data.append(QString::fromUtf8(block));
|
||||
s_instance->emitEvent("newBlock", data);
|
||||
free_cstring(const_cast<char*>(block)); // Free Rust-allocated memory
|
||||
// SAFETY:
|
||||
// We are getting an owned pointer here which is freed after this callback is called, so there is not need to
|
||||
// free the resrouce here as we are copying the data!
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user