From dde00b2f6848a38e9fdbe1e4c85373c8b12944b4 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 12 Apr 2011 22:30:45 -0700 Subject: Convert malloc(strlen()); strcpy() sets to strdup Signed-off-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/InitExt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'nx-X11/lib/X11/InitExt.c') diff --git a/nx-X11/lib/X11/InitExt.c b/nx-X11/lib/X11/InitExt.c index 21c392c0e..fdadd9ef7 100644 --- a/nx-X11/lib/X11/InitExt.c +++ b/nx-X11/lib/X11/InitExt.c @@ -50,14 +50,13 @@ XExtCodes *XInitExtension ( LockDisplay (dpy); if (! (ext = (_XExtension *) Xcalloc (1, sizeof (_XExtension))) || - ! (ext->name = Xmalloc((unsigned) strlen(name) + 1))) { + ! (ext->name = strdup(name))) { if (ext) Xfree((char *) ext); UnlockDisplay(dpy); return (XExtCodes *) NULL; } codes.extension = dpy->ext_number++; ext->codes = codes; - (void) strcpy(ext->name, name); /* chain it onto the display list */ ext->next = dpy->ext_procs; -- cgit v1.2.3