mirror of git://sourceware.org/git/glibc.git
(__duplocale): Update special members only when allocation succeeded.
This commit is contained in:
parent
74ba5a3387
commit
bf418dda29
|
|
@ -49,12 +49,12 @@ __duplocale (__locale_t dataset)
|
||||||
if (result->__locales[cnt]->usage_count < MAX_USAGE_COUNT)
|
if (result->__locales[cnt]->usage_count < MAX_USAGE_COUNT)
|
||||||
++result->__locales[cnt]->usage_count;
|
++result->__locales[cnt]->usage_count;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Update the special members. */
|
/* Update the special members. */
|
||||||
result->__ctype_b = dataset->__ctype_b;
|
result->__ctype_b = dataset->__ctype_b;
|
||||||
result->__ctype_tolower = dataset->__ctype_tolower;
|
result->__ctype_tolower = dataset->__ctype_tolower;
|
||||||
result->__ctype_toupper = dataset->__ctype_toupper;
|
result->__ctype_toupper = dataset->__ctype_toupper;
|
||||||
|
}
|
||||||
|
|
||||||
/* It's done. */
|
/* It's done. */
|
||||||
__libc_lock_unlock (__libc_setlocale_lock);
|
__libc_lock_unlock (__libc_setlocale_lock);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue