summaryrefslogtreecommitdiff
path: root/source4/lib/util_unistr.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/util_unistr.c')
-rw-r--r--source4/lib/util_unistr.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/source4/lib/util_unistr.c b/source4/lib/util_unistr.c
index 8b7504986f..480fb6c72e 100644
--- a/source4/lib/util_unistr.c
+++ b/source4/lib/util_unistr.c
@@ -32,13 +32,9 @@ load the case handling tables
********************************************************************/
static void load_case_tables(void)
{
- static int initialised;
int i;
TALLOC_CTX *mem_ctx;
- if (initialised) return;
- initialised = 1;
-
mem_ctx = talloc_init("load_case_tables");
if (!mem_ctx) {
smb_panic("No memory for case_tables");
@@ -49,9 +45,9 @@ static void load_case_tables(void)
/* we would like Samba to limp along even if these tables are
not available */
- if (!upcase_table) {
+ if (upcase_table == NULL) {
DEBUG(1,("creating lame upcase table\n"));
- upcase_table = malloc(0x20000);
+ upcase_table = talloc_named_const(NULL, 0x20000, "upcase_table");
if (!upcase_table) {
smb_panic("No memory for upcase tables");
}
@@ -63,9 +59,9 @@ static void load_case_tables(void)
}
}
- if (!lowcase_table) {
+ if (lowcase_table == NULL) {
DEBUG(1,("creating lame lowcase table\n"));
- lowcase_table = malloc(0x20000);
+ lowcase_table = talloc_named_const(NULL, 0x20000, "lowcase_table");
if (!lowcase_table) {
smb_panic("No memory for lowcase tables");
}