DRI2: Use single error path in initialization
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
This commit is contained in:
parent
6eef70dc56
commit
f0ab726d89
|
@ -1066,18 +1066,14 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
|
||||||
/* Driver too old: use the old-style driverName field */
|
/* Driver too old: use the old-style driverName field */
|
||||||
ds->numDrivers = 1;
|
ds->numDrivers = 1;
|
||||||
ds->driverNames = malloc(sizeof(*ds->driverNames));
|
ds->driverNames = malloc(sizeof(*ds->driverNames));
|
||||||
if (!ds->driverNames) {
|
if (!ds->driverNames)
|
||||||
free(ds);
|
goto err_out;
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
ds->driverNames[0] = info->driverName;
|
ds->driverNames[0] = info->driverName;
|
||||||
} else {
|
} else {
|
||||||
ds->numDrivers = info->numDrivers;
|
ds->numDrivers = info->numDrivers;
|
||||||
ds->driverNames = malloc(info->numDrivers * sizeof(*ds->driverNames));
|
ds->driverNames = malloc(info->numDrivers * sizeof(*ds->driverNames));
|
||||||
if (!ds->driverNames) {
|
if (!ds->driverNames)
|
||||||
free(ds);
|
goto err_out;
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
memcpy(ds->driverNames, info->driverNames,
|
memcpy(ds->driverNames, info->driverNames,
|
||||||
info->numDrivers * sizeof(*ds->driverNames));
|
info->numDrivers * sizeof(*ds->driverNames));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user