aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs/Xserver/hw')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Error.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Error.c b/nx-X11/programs/Xserver/hw/nxagent/Error.c
index 7abd83ae3..f5fb297b3 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Error.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Error.c
@@ -524,6 +524,7 @@ char *nxagentGetSessionPath(void)
return NULL;
}
+ /* FIXME: necessary? */
snprintf(nxagentSessionDir, DEFAULT_STRING_LENGTH, "%s", rootPath);
if (strlen(nxagentSessionDir) + strlen("/C-") + strlen(nxagentSessionId) > DEFAULT_STRING_LENGTH - 1)
@@ -562,9 +563,9 @@ char *nxagentGetSessionPath(void)
}
- sessionPath = malloc(strlen(nxagentSessionDir) + 1);
+ sessionPath = strdup(nxagentSessionDir);
- if (sessionPath == NULL)
+ if (sessionPath == NULL)
{
#ifdef PANIC
fprintf(stderr, "nxagentGetSessionPath:: PANIC! Can't allocate memory for the session path.\n");
@@ -573,9 +574,6 @@ char *nxagentGetSessionPath(void)
return NULL;
}
-
- strcpy(sessionPath, nxagentSessionDir);
-
return sessionPath;
}