s/drmStrdup/strdup/
_DRM_MALLOC hasn't been a relevant concern since we split libdrm out from xserver. Signed-off-by: Adam Jackson <ajax@redhat.com>main
parent
057fab3382
commit
0a1ff35c70
25
xf86drm.c
25
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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue