Hello,<br>I get a segfault when I do<br>str &lt;- peekCString ptr<br>free ptr<br>return (Just str)<br><br>But not when I don&#39;t free the C pointer.<br>I also get the same behaviour with ByteString.packCString...<br><br>
Could you please tell me if the memory is correctly freed by GHC  when I don&#39;t do it myself?<br>And how can I specify a custom free function (i.e. xmlFree function in libxml2)?<br>Maybe I should use a data type with two fields : the String/ByteString and the ForeignPtr to the CString?<br>
<br>Regards<br>