summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'process.c')
-rw-r--r--process.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/process.c b/process.c
index a4021c7..88424d3 100644
--- a/process.c
+++ b/process.c
@@ -778,10 +778,8 @@ auth_initialize(char *authfilename)
xauth_head = head;
}
- n = strlen (authfilename);
- xauth_filename = malloc (n + 1);
- if (xauth_filename) strcpy (xauth_filename, authfilename);
- else {
+ xauth_filename = strdup(authfilename);
+ if (!xauth_filename) {
fprintf(stderr,"cannot allocate memory\n");
return -1;
}