aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/xkb/XKBGAlloc.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-03-04 15:38:04 +0000
committermarha <marha@users.sourceforge.net>2011-03-04 15:38:04 +0000
commit3592ad31cfc72ffff3c9024eecea7d3b987c7954 (patch)
tree0e3b50cb6bcd0839b591d318a41d04b7cbd8e6e2 /xorg-server/xkb/XKBGAlloc.c
parent79409465b0b8d5d38e6b94deb1943316f40c66eb (diff)
parent0a5888393c68f6f7db86206d1f277232db18240b (diff)
downloadvcxsrv-3592ad31cfc72ffff3c9024eecea7d3b987c7954.tar.gz
vcxsrv-3592ad31cfc72ffff3c9024eecea7d3b987c7954.tar.bz2
vcxsrv-3592ad31cfc72ffff3c9024eecea7d3b987c7954.zip
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/xkb/XKBGAlloc.c')
-rw-r--r--xorg-server/xkb/XKBGAlloc.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/xorg-server/xkb/XKBGAlloc.c b/xorg-server/xkb/XKBGAlloc.c
index d5e49349e..db32dc8c5 100644
--- a/xorg-server/xkb/XKBGAlloc.c
+++ b/xorg-server/xkb/XKBGAlloc.c
@@ -647,9 +647,7 @@ register XkbPropertyPtr prop;
for (i=0,prop=geom->properties;i<geom->num_properties;i++,prop++) {
if ((prop->name)&&(strcmp(name,prop->name)==0)) {
free(prop->value);
- prop->value= malloc(strlen(value)+1);
- if (prop->value)
- strcpy(prop->value,value);
+ prop->value= strdup(value);
return prop;
}
}
@@ -658,17 +656,15 @@ register XkbPropertyPtr prop;
return NULL;
}
prop= &geom->properties[geom->num_properties];
- prop->name= malloc(strlen(name)+1);
- if (!name)
+ prop->name= strdup(name);
+ if (!prop->name)
return NULL;
- strcpy(prop->name,name);
- prop->value= malloc(strlen(value)+1);
- if (!value) {
+ prop->value= strdup(value);
+ if (!prop->value) {
free(prop->name);
prop->name= NULL;
return NULL;
}
- strcpy(prop->value,value);
geom->num_properties++;
return prop;
}
@@ -720,10 +716,9 @@ register XkbColorPtr color;
}
color= &geom->colors[geom->num_colors];
color->pixel= pixel;
- color->spec= malloc(strlen(spec)+1);
+ color->spec= strdup(spec);
if (!color->spec)
return NULL;
- strcpy(color->spec,spec);
geom->num_colors++;
return color;
}