[Numpy-svn] r5442 - branches/1.1.x/numpy/core/blasdot

numpy-svn at scipy.org numpy-svn at scipy.org
Wed Jul 16 17:34:01 EDT 2008


Author: charris
Date: 2008-07-16 16:33:55 -0500 (Wed, 16 Jul 2008)
New Revision: 5442

Modified:
   branches/1.1.x/numpy/core/blasdot/_dotblas.c
Log:
Backport fix for ticket #849.

Modified: branches/1.1.x/numpy/core/blasdot/_dotblas.c
===================================================================
--- branches/1.1.x/numpy/core/blasdot/_dotblas.c	2008-07-16 21:32:41 UTC (rev 5441)
+++ branches/1.1.x/numpy/core/blasdot/_dotblas.c	2008-07-16 21:33:55 UTC (rev 5442)
@@ -234,13 +234,21 @@
     }
 
     dtype = PyArray_DescrFromType(typenum);
+    if (dtype == NULL) {
+        return NULL;
+    }
+    Py_INCREF(dtype);
     ap1 = (PyArrayObject *)PyArray_FromAny(op1, dtype, 0, 0, ALIGNED, NULL);
-    if (ap1 == NULL) return NULL;
-    Py_INCREF(dtype);
+    if (ap1 == NULL) {
+        Py_DECREF(dtype);
+        return NULL;
+    }
     ap2 = (PyArrayObject *)PyArray_FromAny(op2, dtype, 0, 0, ALIGNED, NULL);
-    if (ap2 == NULL) goto fail;
+    if (ap2 == NULL) {
+        Py_DECREF(ap1);
+        return NULL;
+    }
 
-
     if ((ap1->nd > 2) || (ap2->nd > 2)) {
 	/* This function doesn't handle dimensions greater than 2 
 	   (or negative striding)  -- other




More information about the Numpy-svn mailing list