diff --git a/src/statement.rs b/src/statement.rs index 10a8b5e..d467a02 100644 --- a/src/statement.rs +++ b/src/statement.rs @@ -1,5 +1,6 @@ use ffi; -use libc::{c_double, c_int}; +use libc::{c_double, c_int, c_void}; +use std::ffi::CString; use std::marker::PhantomData; use {Cursor, Result, Type, Value}; @@ -161,7 +162,8 @@ impl<'l> Bindable for &'l str { debug_assert!(i > 0, "the indexing starts from 1"); unsafe { ok!(statement.raw.1, ffi::sqlite3_bind_text(statement.raw.0, i as c_int, - str_to_cstr!(*self).as_ptr(), -1, None)); + str_to_cstr!(*self).into_raw(), -1, + Some(drop_cstring))); } Ok(()) } @@ -250,3 +252,7 @@ pub fn new<'l, T: AsRef>(raw1: *mut ffi::sqlite3, statement: T) -> Result