summaryrefslogtreecommitdiff
path: root/glx
diff options
context:
space:
mode:
authorMikhail Gusarov <dottedmag@dottedmag.net>2010-06-04 16:58:58 +0700
committerMikhail Gusarov <dottedmag@dottedmag.net>2010-06-11 19:04:23 +0700
commit6592db6bb526f0c43b4c7b55859c629709e039b4 (patch)
tree30d525b635170a94193c0a8837e1b36b609e757e /glx
parent620ca54aaa0b363fcf68cec1bd6c37e68c988352 (diff)
Get rid of xstrdup when argument is definitely non-NULL
Replace xstrdup with strdup when either constant string is being duplicated or argument is guarded by conditionals and obviously can't be NULL Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'glx')
-rw-r--r--glx/glxcmds.c2
-rw-r--r--glx/glxscreens.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 1d3be4921..9e5b2139e 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -2433,7 +2433,7 @@ int __glXDisp_ClientInfo(__GLXclientState *cl, GLbyte *pc)
cl->GLClientminorVersion = req->minor;
free(cl->GLClientextensions);
buf = (const char *)(req+1);
- cl->GLClientextensions = xstrdup(buf);
+ cl->GLClientextensions = strdup(buf);
return Success;
}
diff --git a/glx/glxscreens.c b/glx/glxscreens.c
index a5b61df9f..8515e14d5 100644
--- a/glx/glxscreens.c
+++ b/glx/glxscreens.c
@@ -356,9 +356,9 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
return;
pGlxScreen->pScreen = pScreen;
- pGlxScreen->GLextensions = xstrdup(GLServerExtensions);
- pGlxScreen->GLXvendor = xstrdup(GLXServerVendorName);
- pGlxScreen->GLXextensions = xstrdup(GLXServerExtensions);
+ pGlxScreen->GLextensions = strdup(GLServerExtensions);
+ pGlxScreen->GLXvendor = strdup(GLXServerVendorName);
+ pGlxScreen->GLXextensions = strdup(GLXServerExtensions);
/* All GLX providers must support all of the functionality required for at
* least GLX 1.2. If the provider supports a higher version, the GLXminor