aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Font.c
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Font.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Font.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c
index 197f0c84a..5af88b137 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Font.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c
@@ -334,10 +334,12 @@ void nxagentListRemoteAddName(const char *name, int status)
if ((nxagentRemoteFontList.list[pos] = malloc(sizeof(nxagentFontRec))))
{
- nxagentRemoteFontList.list[pos]->name = malloc(strlen(name) +1);
+ nxagentRemoteFontList.list[pos]->name = strdup(name);
if (nxagentRemoteFontList.list[pos]->name == NULL)
{
fprintf(stderr, "Font: remote list name memory allocation failed!.\n");
+ free(nxagentRemoteFontList.list[pos]);
+ nxagentRemoteFontList.list[pos] = NULL;
return;
}
}
@@ -346,7 +348,6 @@ void nxagentListRemoteAddName(const char *name, int status)
fprintf(stderr, "Font: remote list record memory allocation failed!.\n");
return;
}
- strcpy(nxagentRemoteFontList.list[pos]->name,name);
nxagentRemoteFontList.list[pos]->status = status;
nxagentRemoteFontList.length++;