summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPauli Nieminen <ext-pauli.nieminen@nokia.com>2010-04-21 11:07:47 +0300
committerTiago Vignatti <tiago.vignatti@nokia.com>2010-06-03 11:56:56 +0300
commitf0ab726d8966cab4e50154c216d577db79328d77 (patch)
treee36de265de2bf53faaca97b16b3481fb84e61240
parent6eef70dc56bcc1e3047e4e488bcd6ae62c8ffac6 (diff)
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>
-rw-r--r--hw/xfree86/dri2/dri2.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index e1ccdae93..556285383 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -1066,18 +1066,14 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
/* Driver too old: use the old-style driverName field */
ds->numDrivers = 1;
ds->driverNames = malloc(sizeof(*ds->driverNames));
- if (!ds->driverNames) {
- free(ds);
- return FALSE;
- }
+ if (!ds->driverNames)
+ goto err_out;
ds->driverNames[0] = info->driverName;
} else {
ds->numDrivers = info->numDrivers;
ds->driverNames = malloc(info->numDrivers * sizeof(*ds->driverNames));
- if (!ds->driverNames) {
- free(ds);
- return FALSE;
- }
+ if (!ds->driverNames)
+ goto err_out;
memcpy(ds->driverNames, info->driverNames,
info->numDrivers * sizeof(*ds->driverNames));
}