summaryrefslogtreecommitdiffstats
path: root/utils/mountd/auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils/mountd/auth.c')
-rw-r--r--utils/mountd/auth.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/utils/mountd/auth.c b/utils/mountd/auth.c
index f7fe23d..950ea20 100644
--- a/utils/mountd/auth.c
+++ b/utils/mountd/auth.c
@@ -93,8 +93,13 @@ auth_authenticate_internal(char *what, struct sockaddr_in *caller,
*error = unknown_host;
if (!n)
return NULL;
- strcpy(my_client.m_hostname, *n?n:"DEFAULT");
- free(n);
+ free(my_client.m_hostname);
+ if (*n) {
+ my_client.m_hostname = n;
+ } else {
+ free(n);
+ my_client.m_hostname = xstrdup("DEFAULT");
+ }
my_client.m_naddr = 1;
my_exp.m_client = &my_client;