summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index bf6c8c5302..51680923fd 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -1462,10 +1462,12 @@ char *myhostname(void)
char *myhostname_upper(void)
{
- char *name;
static char *ret;
if (ret == NULL) {
- name = get_myname(talloc_tos());
+ char *name = get_myname(NULL);
+ if (name == NULL) {
+ return NULL;
+ }
ret = strupper_talloc(NULL, name);
talloc_free(name);
}