Commit b89b8094 authored by Ulrich Sibiller's avatar Ulrich Sibiller

Error.c: replace malloc+strcpy by strdup

parent 27a31d0c
......@@ -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,7 +563,7 @@ char *nxagentGetSessionPath(void)
}
sessionPath = malloc(strlen(nxagentSessionDir) + 1);
sessionPath = strdup(nxagentSessionDir);
if (sessionPath == NULL)
{
......@@ -573,9 +574,6 @@ char *nxagentGetSessionPath(void)
return NULL;
}
strcpy(sessionPath, nxagentSessionDir);
return sessionPath;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment