[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg-devel
Subject:    [PATCH v6 3/3] DRI2: Use single error path in initialization
From:       Pauli Nieminen <ext-pauli.nieminen () nokia ! com>
Date:       2010-05-31 9:52:08
Message-ID: 1275299528-10712-3-git-send-email-ext-pauli.nieminen () nokia ! com
[Download RAW message or body]

Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
---
 hw/xfree86/dri2/dri2.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index c4878d1..2d4c7d3 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));
     }
-- 
1.6.3.3

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic