Skip to content

Commit

Permalink
Bug 1445601 - Stop using LoadLibraryA in replace_malloc. r=glandium
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: 8EzDtCIlg7F

--HG--
extra : rebase_source : cf909f472c1c0007b2ff759d011435b8b6bc0f37
  • Loading branch information
vyv03354 committed Mar 25, 2018
1 parent 26923e2 commit e98b2c4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions memory/build/mozjemalloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@

#include "mozilla/Atomics.h"
#include "mozilla/Alignment.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/Assertions.h"
#include "mozilla/Attributes.h"
#include "mozilla/CheckedInt.h"
Expand Down Expand Up @@ -4685,11 +4686,11 @@ typedef HMODULE replace_malloc_handle_t;
static replace_malloc_handle_t
replace_malloc_handle()
{
char replace_malloc_lib[1024];
if (GetEnvironmentVariableA("MOZ_REPLACE_MALLOC_LIB",
wchar_t replace_malloc_lib[1024];
if (GetEnvironmentVariableW(L"MOZ_REPLACE_MALLOC_LIB",
replace_malloc_lib,
sizeof(replace_malloc_lib)) > 0) {
return LoadLibraryA(replace_malloc_lib);
ArrayLength(replace_malloc_lib)) > 0) {
return LoadLibraryW(replace_malloc_lib);
}
return nullptr;
}
Expand Down

0 comments on commit e98b2c4

Please sign in to comment.