Menu

#1 Freeing memory of tidyReleaseDate()

open
nobody
None
5
2008-01-06
2008-01-06
Anonymous
No

In the C# wrapper, in the Tidy.Cs on line the property ReleaseString frees memory it hasn't allocated. The C TidyHtml examples don't free this memory either, and it causes a crash on FreeBSD:

New code:
---
public static string ReleaseString
{
get
{
IntPtr releaseDate = TidyWrapper.tidyReleaseDate();
string value = Marshal.PtrToStringAnsi(releaseDate);
// Crashes: Marshal.FreeBSTR(releaseDate);

return value;
}
}
---

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.