File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -2036,6 +2036,7 @@ char* CDECL setlocale(int category, const char* locale)
20362036{
20372037 thread_data_t * data = msvcrt_get_thread_data ();
20382038 pthreadlocinfo locinfo = get_locinfo (), newlocinfo ;
2039+ BOOL need_free ;
20392040
20402041 if (category < LC_MIN || category > LC_MAX )
20412042 return NULL ;
@@ -2047,7 +2048,12 @@ char* CDECL setlocale(int category, const char* locale)
20472048 return locinfo -> lc_category [category ].locale ;
20482049 }
20492050
2051+ if ((need_free = (locinfo && data -> locale_flags & LOCALE_FREE )))
2052+ grab_locinfo (locinfo );
20502053 newlocinfo = create_locinfo (category , locale , locinfo );
2054+ if (need_free )
2055+ free_locinfo (locinfo );
2056+
20512057 if (!newlocinfo ) {
20522058 WARN ("%d %s failed\n" , category , locale );
20532059 return NULL ;
You can’t perform that action at this time.
0 commit comments