On Dec 23, 2009, at 11:26 PM, John Mettraux wrote: > On Thu, Dec 24, 2009 at 12:41 PM, James Edward Gray II > <james / graysoftinc.com> wrote: >> I've found a memory leak in some FFI code. I'll give example code = below, but I can explain the issue easily enough first. >>=20 >> When calling a function provided by Tokyo Cabinet, it returns a value = in the form of a pointer and a length to read at that address. The = documentation for the function (tchdbget() at = http://1978th.net/tokyocabinet/spex-en.html#tchdbapi, if you are = interested) warns that the returned region was allocated with malloc() = and needs to be free()d. I can't figure out how to free the value, so = there is a memory leak. What I would like to know is how to free the = value at the end of the pointer. >=20 > Hello, >=20 > maybe >=20 > http://gist.github.com/263033 >=20 > or >=20 > http://gist.github.com/263034 >=20 > Seems to work. Yeah, those do seem to work. Awesome. Thanks for the help! James Edward Gray II=