From 3b1c2f8fc4f3d45d8147962f6142ad99f9d02a21 Mon Sep 17 00:00:00 2001 From: Arnaud Date: Sat, 13 Jun 2026 11:23:12 +0400 Subject: [PATCH] Fix usage of req after free --- library/storage_context.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/storage_context.nim b/library/storage_context.nim index c5eddd2b..f2074957 100644 --- a/library/storage_context.nim +++ b/library/storage_context.nim @@ -94,8 +94,9 @@ proc sendRequestToStorageThread*( # Send the request to the Logos Storage thread let sentOk = ctx.reqChannel.trySend(req) if not sentOk: + let reqDesc = $req[] deallocShared(req) - return err("Failed to send request to the Logos Storage thread: " & $req[]) + return err("Failed to send request to the Logos Storage thread: " & reqDesc) # Notify the Logos Storage thread that a request is available let fireSyncRes = ctx.reqSignal.fireSync()