Closed
Bug 564068
Opened 15 years ago
Closed 15 years ago
Test plugin should use NPN allocator to create strings
Categories
(Core Graveyard :: Plug-ins, defect)
Core Graveyard
Plug-ins
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: neil, Unassigned)
Details
Attachments
(1 file)
1.54 KB,
patch
|
jst
:
review+
|
Details | Diff | Splinter Review |
STRINGZ_TO_NPVARIANT assumes a string allocated with memalloc, not strdup. The test plugin can cheat because it links with MOZCRT19, but real plugins won't.
There's no NPN strdup function, but one could be created like this:
char*
NPN_StrDup(const char* str)
{
return strcpy((char*)sBrowserFuncs->memalloc(strlen(str) + 1), str);
}
Reporter | ||
Comment 1•15 years ago
|
||
Also the test plugin needs to be compiled with USE_STATIC_LIBS=1 to stop this mistake happening in future.
Reporter | ||
Comment 2•15 years ago
|
||
If I only set USE_STATIC_LIBS = 1 then my debug non-jemalloc build aborts the test because it tries to free memory allocated on the wrong heap, and the rest of the patch fixes that. I'm not actually sure that any tinderboxes would test for that, since I can't build with jemalloc.
Attachment #444203 -
Flags: review?(jst)
Updated•15 years ago
|
Attachment #444203 -
Flags: review?(jst) → review+
Reporter | ||
Comment 3•15 years ago
|
||
Pushed changeset aa0171d36805 to mozilla-central.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Updated•3 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•