Skip to content

Commit

Permalink
FIX: ATRONIX: Memory from OS_Get_Locale should be free according to i…
Browse files Browse the repository at this point in the history
…ts doc

(cherry picked from commit 253c64b)
  • Loading branch information
Oldes committed Jan 25, 2019
1 parent c20872e commit 3725a33
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/b-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,21 +835,25 @@ static REBCNT Set_Option_Word(REBCHR *str, REBCNT field)
if (NZ(data = OS_GET_LOCALE(0))) {
val = Get_System(SYS_LOCALE, LOCALE_LANGUAGE);
Set_String(val, Copy_OS_Str(data, (REBINT)LEN_STR(data)));
OS_FREE(data);
}

if (NZ(data = OS_GET_LOCALE(1))) {
val = Get_System(SYS_LOCALE, LOCALE_LANGUAGE_P);
Set_String(val, Copy_OS_Str(data, (REBINT)LEN_STR(data)));
OS_FREE(data);
}

if (NZ(data = OS_GET_LOCALE(2))) {
val = Get_System(SYS_LOCALE, LOCALE_LOCALE);
Set_String(val, Copy_OS_Str(data, (REBINT)LEN_STR(data)));
OS_FREE(data);
}

if (NZ(data = OS_GET_LOCALE(3))) {
val = Get_System(SYS_LOCALE, LOCALE_LOCALE_P);
Set_String(val, Copy_OS_Str(data, (REBINT)LEN_STR(data)));
OS_FREE(data);
}
}

Expand Down

0 comments on commit 3725a33

Please sign in to comment.