protover: Fix memleak in Rust implementation.

* FIXES #25127: https://bugs.torproject.org/25127.
This commit is contained in:
Isis Lovecruft
2018-02-06 02:31:04 +00:00
parent b5a8fd1566
commit 7ea9e080c5
3 changed files with 54 additions and 27 deletions
+7
View File
@@ -0,0 +1,7 @@
o Minor bugfixes (Rust FFI):
- Fix a minor memory leak which would happen whenever the C code would call
the Rust implementation of protover_get_supported_protocols(). This was
due to the C version returning a static string, whereas the Rust version
newly allocated a CString to pass accross the FFI boundary. Consequently,
the C code was not expecting to need to free() what it was given. Fixes
bug 25127; bugfix on 0.3.2.1-alpha.