[PATCH:libX11 7/7] lcPubWrap: replace malloc(strlen) + strcpy with strdup
Alan Coopersmith
alan.coopersmith at oracle.com
Fri Jan 1 18:15:02 PST 2016
Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
src/xlibi18n/lcPubWrap.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/xlibi18n/lcPubWrap.c b/src/xlibi18n/lcPubWrap.c
index d1096d5..3119918 100644
--- a/src/xlibi18n/lcPubWrap.c
+++ b/src/xlibi18n/lcPubWrap.c
@@ -78,10 +78,9 @@ _XlcCreateLC(
return (XLCd) NULL;
if (lcd->core->name == NULL) {
- lcd->core->name = Xmalloc(strlen(name) + 1);
+ lcd->core->name = strdup(name);
if (lcd->core->name == NULL)
goto err;
- strcpy(lcd->core->name, name);
}
if (lcd->methods == NULL)
--
2.6.1
More information about the xorg-devel
mailing list