summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xf86drm.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/xf86drm.c b/xf86drm.c
index e48b9c99..896b9ba0 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -155,23 +155,6 @@ void drmFree(void *pt)
free(pt);
}
-/* drmStrdup can't use strdup(3), since it doesn't call _DRM_MALLOC... */
-static char *drmStrdup(const char *s)
-{
- char *retval;
-
- if (!s)
- return NULL;
-
- retval = malloc(strlen(s)+1);
- if (!retval)
- return NULL;
-
- strcpy(retval, s);
-
- return retval;
-}
-
/**
* Call ioctl, restarting if it is interupted
*/
@@ -726,11 +709,11 @@ static void drmCopyVersion(drmVersionPtr d, const drm_version_t *s)
d->version_minor = s->version_minor;
d->version_patchlevel = s->version_patchlevel;
d->name_len = s->name_len;
- d->name = drmStrdup(s->name);
+ d->name = strdup(s->name);
d->date_len = s->date_len;
- d->date = drmStrdup(s->date);
+ d->date = strdup(s->date);
d->desc_len = s->desc_len;
- d->desc = drmStrdup(s->desc);
+ d->desc = strdup(s->desc);
}
@@ -2543,5 +2526,5 @@ char *drmGetDeviceNameFromFd(int fd)
if (i == DRM_MAX_MINOR)
return NULL;
- return drmStrdup(name);
+ return strdup(name);
}