summaryrefslogtreecommitdiff
path: root/source3/lib/charcnv.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-08-12 13:35:15 -0700
committerJeremy Allison <jra@samba.org>2008-08-12 13:35:15 -0700
commit03991ab0734ecbb87a75238d1356fbe0e5b1d38d (patch)
treec96c68c0f2fd8359c2250621f4b0938903ae385f /source3/lib/charcnv.c
parent9caabc441b3bfe860f9719cf64b6646f58a5cb59 (diff)
downloadsamba-03991ab0734ecbb87a75238d1356fbe0e5b1d38d.tar.gz
samba-03991ab0734ecbb87a75238d1356fbe0e5b1d38d.tar.bz2
samba-03991ab0734ecbb87a75238d1356fbe0e5b1d38d.zip
Fix bug 5686 - libsmbclient segfaults with more than one SMBCCTX.
Here is a patch to allow many subsystems to be re-initialized. The only functional change I made was to remove the null context tracking, as the memory allocated here is designed to be left for the complete lifetime of the program. Freeing this early (when all smb contexts are destroyed) could crash other users of talloc. Jeremy. (This used to be commit 8c630efd25cf17aff59448ca05c1b44a41964b16)
Diffstat (limited to 'source3/lib/charcnv.c')
-rw-r--r--source3/lib/charcnv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c
index b1a5393461..485212b100 100644
--- a/source3/lib/charcnv.c
+++ b/source3/lib/charcnv.c
@@ -47,6 +47,7 @@ char lp_failed_convert_char(void)
static smb_iconv_t conv_handles[NUM_CHARSETS][NUM_CHARSETS];
static bool conv_silent; /* Should we do a debug if the conversion fails ? */
+static bool initialized;
/**
* Return the name of a charset to give to iconv().
@@ -92,12 +93,10 @@ static const char *charset_name(charset_t ch)
void lazy_initialize_conv(void)
{
- static int initialized = False;
-
if (!initialized) {
- initialized = True;
load_case_tables();
init_iconv();
+ initialized = true;
}
}
@@ -116,6 +115,7 @@ void gfree_charcnv(void)
}
}
}
+ initialized = false;
}
/**