User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040514 Build Identifier: nightly 1.8, FTP source: mozilla-source.tar.bz2 2004/05/19 16:16:00 nsStandardUrl allocates some memory with nsCRT::strdup and then frees it by calling free() directly. This causes (non-fatal) exceptions to be thrown on Windows. The problem is that NSPR mallocs are done in a DLL and need to be free'd from that same DLL. Thus malloc/free or PR_Malloc/PR_Free but not a mix. Reproducible: Always Steps to Reproduce: Expected Results: See attached patch.
Created attachment 148917 [details] [diff] [review] patch The change to PR_Malloc/PR_Free in EncodeString() isn't strictly necessary as the allocated memory never makes it out of the function. However in the name of consistency I changed it over too.
this is already known as bug 243079... although that bug is really unfindable. I resummarized it to make it a bit easier to find. fwiw I prefer this patch to the suggestions in that bug... *** This bug has been marked as a duplicate of 243079 ***