summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbindgen/src/clang.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/libbindgen/src/clang.rs b/libbindgen/src/clang.rs
index d10457b3..15f288dd 100644
--- a/libbindgen/src/clang.rs
+++ b/libbindgen/src/clang.rs
@@ -933,7 +933,9 @@ impl Into<String> for CXString {
}
unsafe {
let c_str = CStr::from_ptr(clang_getCString(self) as *const _);
- c_str.to_string_lossy().into_owned()
+ let ret = c_str.to_string_lossy().into_owned();
+ clang_disposeString(self);
+ ret
}
}
}