diff options
author | Jeremy Allison <jra@samba.org> | 1998-09-28 23:55:09 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-09-28 23:55:09 +0000 |
commit | 008fd973097303ac984cd7c004e3dea67d54813d (patch) | |
tree | 9b3d2d82075cf04cbff491c9754cdedf103aeb0d /source3/lib/util.c | |
parent | d455d42234ebe28f00ae360627fcb2a2f88787e0 (diff) | |
download | samba-008fd973097303ac984cd7c004e3dea67d54813d.tar.gz samba-008fd973097303ac984cd7c004e3dea67d54813d.tar.bz2 samba-008fd973097303ac984cd7c004e3dea67d54813d.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.
(This used to be commit 3fd28812f75f2311a114ff905143634e3bbb1fac)
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r-- | source3/lib/util.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c index e82abf8c7c..8561c4f3f4 100644 --- a/source3/lib/util.c +++ b/source3/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 |