From 9b110f5374be9eb2d1084d18c890cb76fefd0a7e Mon Sep 17 00:00:00 2001 From: Simone Mosciatti Date: Wed, 14 Aug 2019 13:52:28 +0200 Subject: [PATCH] fix memory leak --- src/commands.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/commands.rs b/src/commands.rs index 6e28841..f57cd03 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -32,8 +32,10 @@ extern "C" fn reply( context.as_ptr(), ) as *mut *mut RedisReply }; + let result_wrap: Box<*mut r::RedisReply> = + unsafe { Box::from_raw(result) }; let mut result: Box = - unsafe { Box::from_raw(*result) }; + unsafe { Box::from_raw(*result_wrap) }; result.reply(&context) }