summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-09-09 15:29:03 -0700
committerJeremy Allison <jra@samba.org>2010-09-09 15:29:03 -0700
commit718fd39f10310d10ebc2276021d97d48f1163a88 (patch)
treec3131e859fbf5186596e7f04284095dcde6215c9 /source3/lib
parente6b85c2a7b3cfa0dd3c9859c88e5462c616d5a2a (diff)
downloadsamba-718fd39f10310d10ebc2276021d97d48f1163a88.tar.gz
samba-718fd39f10310d10ebc2276021d97d48f1163a88.tar.bz2
samba-718fd39f10310d10ebc2276021d97d48f1163a88.zip
Fox missing SMB_MALLOC return checks noticed by "Andreas Moroder <andreas.moroder@gmx.net>".
Jeremy.
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_str.c3
-rw-r--r--source3/lib/util_unistr.c10
2 files changed, 13 insertions, 0 deletions
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index f93832e752..449b5d1a60 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -2067,6 +2067,9 @@ void string_append(char **left, const char *right)
if (*left == NULL) {
*left = (char *)SMB_MALLOC(new_len);
+ if (*left == NULL) {
+ return;
+ }
*left[0] = '\0';
} else {
new_len += strlen(*left);
diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c
index f53ef94d69..4cda38dc19 100644
--- a/source3/lib/util_unistr.c
+++ b/source3/lib/util_unistr.c
@@ -109,6 +109,11 @@ void load_case_tables(void)
if (!upcase_table) {
DEBUG(1,("creating lame upcase table\n"));
upcase_table = (smb_ucs2_t *)SMB_MALLOC(0x20000);
+ if (!upcase_table) {
+ smb_panic("lame upcase table malloc fail");
+ /* notreached. */
+ return;
+ }
for (i=0;i<0x10000;i++) {
smb_ucs2_t v;
SSVAL(&v, 0, i);
@@ -124,6 +129,11 @@ void load_case_tables(void)
if (!lowcase_table) {
DEBUG(1,("creating lame lowcase table\n"));
lowcase_table = (smb_ucs2_t *)SMB_MALLOC(0x20000);
+ if (!lowcase_table) {
+ smb_panic("lame lowcase table malloc fail");
+ /* notreached. */
+ return;
+ }
for (i=0;i<0x10000;i++) {
smb_ucs2_t v;
SSVAL(&v, 0, i);