From 08248235985e249bf781d73270acd263451b8928 Mon Sep 17 00:00:00 2001 From: danielSanchezQ <3danimanimal@gmail.com> Date: Wed, 18 Feb 2026 18:03:24 +0000 Subject: [PATCH] Fix double free --- flake.lock | 6 +++--- src/logos_blockchain_module.cpp | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 595e3d7..483ab55 100644 --- a/flake.lock +++ b/flake.lock @@ -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": { diff --git a/src/logos_blockchain_module.cpp b/src/logos_blockchain_module.cpp index 6133582..d46788b 100644 --- a/src/logos_blockchain_module.cpp +++ b/src/logos_blockchain_module.cpp @@ -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(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! } }