Skip to content

Commit

Permalink
updated based on PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Polyakovsky committed Apr 23, 2024
1 parent 73e9860 commit 332ff08
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
# will have compiled files and executables
**/target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
# Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

Expand All @@ -23,4 +19,4 @@ dump.rdb
.gdb_history

venv/
tmp/*
tmp/*
4 changes: 2 additions & 2 deletions src/context/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,12 +454,12 @@ api! {[
// the only CString pointers which are not freed are those of the key_specs, lets free them here.
key_specs.into_iter().for_each(|v|{
if !v.notes.is_null() {
unsafe{let _ = CString::from_raw(v.notes as *mut c_char);};
unsafe{drop(CString::from_raw(v.notes as *mut c_char))};
}
if v.begin_search_type == raw::RedisModuleKeySpecBeginSearchType_REDISMODULE_KSPEC_BS_KEYWORD {
let keyword = unsafe{v.bs.keyword.keyword};
if !keyword.is_null() {
unsafe{let _= CString::from_raw(v.bs.keyword.keyword as *mut c_char);};
unsafe{drop(CString::from_raw(v.bs.keyword.keyword as *mut c_char))};
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ impl Context {

extern "C" fn post_notification_job_free_callback<F: FnOnce(&Context)>(pd: *mut c_void) {
unsafe {
let _ = Box::from_raw(pd as *mut Option<F>);
drop(Box::from_raw(pd as *mut Option<F>));
};
}

Expand Down

0 comments on commit 332ff08

Please sign in to comment.