nsStandardUrl mixes calls between NSPR malloc and clib free

VERIFIED DUPLICATE of bug 243079

Status

()

Core
Networking
VERIFIED DUPLICATE of bug 243079
14 years ago
14 years ago

People

(Reporter: Brodie, Assigned: Darin Fisher)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

14 years ago
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.
(Reporter)

Comment 1

14 years ago
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 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → DUPLICATE

Comment 3

14 years ago
v/dupe.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.