diff options
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 |