diff options
Diffstat (limited to 'src/util.rs')
-rw-r--r-- | src/util.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/util.rs b/src/util.rs index d764baa..6f4fbb0 100644 --- a/src/util.rs +++ b/src/util.rs @@ -73,11 +73,10 @@ pub fn result_from_string(ptr: *const c_char) -> Result<String, CommandError> { } unsafe { let s = owned_str_from_ptr(ptr); + free(ptr as *mut c_void); if s.is_empty() { return Err(get_last_error()); } - // TODO: move up for newer libnitrokey versions - free(ptr as *mut c_void); return Ok(s); } } |