summaryrefslogtreecommitdiffstats
path: root/source/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-09-28 23:55:09 +0000
committerJeremy Allison <jra@samba.org>1998-09-28 23:55:09 +0000
commit3fd28812f75f2311a114ff905143634e3bbb1fac (patch)
tree09d73a770fe3da8e44485d5c0c421b4d5c9c29ee /source/lib
parent2c6bbc2da72af4508aa8c49d003f211da5cbe5ae (diff)
downloadsamba-3fd28812f75f2311a114ff905143634e3bbb1fac.tar.gz
samba-3fd28812f75f2311a114ff905143634e3bbb1fac.tar.xz
samba-3fd28812f75f2311a114ff905143634e3bbb1fac.zip
Fixed problems found in lint pass over the old code by <cpeterso@microsoft.com>.
These were the problems that still existed in the 2.0 branch. Jeremy.
Diffstat (limited to 'source/lib')
-rw-r--r--source/lib/kanji.c2
-rw-r--r--source/lib/util.c11
2 files changed, 9 insertions, 4 deletions
diff --git a/source/lib/kanji.c b/source/lib/kanji.c
index 4ca5984d806..04eecb54375 100644
--- a/source/lib/kanji.c
+++ b/source/lib/kanji.c
@@ -1173,6 +1173,7 @@ void initialize_multibyte_vectors( int client_codepage)
multibyte_strtok = (char *(*)(char *, char *)) generic_multibyte_strtok;
_skip_multibyte_char = skip_generic_multibyte_char;
is_multibyte_char_1 = hangul_is_multibyte_char_1;
+ break;
case BIG5_CODEPAGE:
multibyte_strchr = (char *(*)(char *, int )) generic_multibyte_strchr;
multibyte_strrchr = (char *(*)(char *, int )) generic_multibyte_strrchr;
@@ -1180,6 +1181,7 @@ void initialize_multibyte_vectors( int client_codepage)
multibyte_strtok = (char *(*)(char *, char *)) generic_multibyte_strtok;
_skip_multibyte_char = skip_generic_multibyte_char;
is_multibyte_char_1 = big5_is_multibyte_char_1;
+ break;
case SIMPLIFIED_CHINESE_CODEPAGE:
multibyte_strchr = (char *(*)(char *, int )) generic_multibyte_strchr;
multibyte_strrchr = (char *(*)(char *, int )) generic_multibyte_strrchr;
diff --git a/source/lib/util.c b/source/lib/util.c
index e82abf8c7c9..8561c4f3f4a 100644
--- a/source/lib/util.c
+++ b/source/lib/util.c
@@ -2454,10 +2454,13 @@ BOOL string_init(char **dest,char *src)
if (l == 0)
{
- if (!null_string)
- null_string = (char *)malloc(1);
-
- *null_string = 0;
+ if (!null_string) {
+ if((null_string = (char *)malloc(1)) == NULL) {
+ DEBUG(0,("string_init: malloc fail for null_string.\n"));
+ return False;
+ }
+ *null_string = 0;
+ }
*dest = null_string;
}
else