Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146962746
D26522.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D26522.diff
View Options
Index: head/lib/libc/locale/newlocale.3
===================================================================
--- head/lib/libc/locale/newlocale.3
+++ head/lib/libc/locale/newlocale.3
@@ -26,7 +26,7 @@
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD$
-.Dd September 17, 2011
+.Dd October 2, 2020
.Dt NEWLOCALE 3
.Os
.Sh NAME
@@ -46,7 +46,20 @@
name specified in the
.Fa locale
parameter.
-Any other components will be inherited from
+Any components not specified in
+.Fa mask
+will be inherited from the locale referenced by
+.Fa base ,
+if
+.Fa base
+is not
+.Dv NULL .
+If the call is successful, the state of the locale referenced by
+.Fa base
+is unspecified, and it must not be accessed.
+The special locale
+.Dv LC_GLOBAL_LOCALE
+may not be specified for
.Fa base .
The
.Fa mask
Index: head/lib/libc/locale/xlocale.c
===================================================================
--- head/lib/libc/locale/xlocale.c
+++ head/lib/libc/locale/xlocale.c
@@ -251,6 +251,7 @@
locale_t newlocale(int mask, const char *locale, locale_t base)
{
+ locale_t orig_base;
int type;
const char *realLocale = locale;
int useenv = 0;
@@ -263,6 +264,7 @@
return (NULL);
}
+ orig_base = base;
FIX_LOCALE(base);
copyflags(new, base);
@@ -297,6 +299,8 @@
if (0 == success) {
xlocale_release(new);
new = NULL;
+ } else if (base == orig_base) {
+ xlocale_release(base);
}
return (new);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 8, 4:25 AM (9 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29394599
Default Alt Text
D26522.diff (1 KB)
Attached To
Mode
D26522: newlocale(3): Fix a memory leak.
Attached
Detach File
Event Timeline
Log In to Comment