Skip to content

Commit 963fa58

Browse files
author
duke
committed
Backport ce188fdacab9fd1cb841d0ccd5c385f47b348791
1 parent 1a06a61 commit 963fa58

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/hotspot/gtest/compiler/test_directivesParser.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,16 @@
3232

3333
class DirectivesParserTest : public ::testing::Test{
3434
protected:
35-
const char* const _locale;
35+
char* const _locale;
3636
ResourceMark rm;
3737
stringStream stream;
3838
// These tests require the "C" locale to correctly parse decimal values
39-
DirectivesParserTest() : _locale(setlocale(LC_NUMERIC, NULL)) {
39+
DirectivesParserTest() : _locale(os::strdup(setlocale(LC_NUMERIC, nullptr), mtTest)) {
4040
setlocale(LC_NUMERIC, "C");
4141
}
4242
~DirectivesParserTest() {
4343
setlocale(LC_NUMERIC, _locale);
44+
os::free(_locale);
4445
}
4546

4647
void test_negative(const char* text) {

0 commit comments

Comments
 (0)